Connect Hive through Java JDBC

后端 未结 6 663
北海茫月
北海茫月 2021-02-06 02:29

There is a question here connect from java to Hive but mine is different

My hive running on machine1 and I need to pass some queries using Java server

6条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-06 03:07

    Answering my own question!

    With some hit and trial, I have added following dependencies on my pom file and since then I am able to run code on both CHD 5.3.1 and 5.2.1 cluster.

    
        org.apache.hive
        hive-jdbc
        0.13.1-cdh5.3.1
    
    
        org.apache.thrift
        libthrift
        0.9.0
    
    
        org.apache.thrift
        libfb303
        0.9.0
    
    
        org.apache.hadoop
        hadoop-core
        2.5.0-mr1-cdh5.3.1
    
    
    
        org.apache.hadoop
        hadoop-common
        2.5.0-cdh5.3.1
    
    
        org.apache.hive
        hive-exec
        0.13.1-cdh5.3.1
    
    
        org.apache.hadoop
        hadoop-hdfs
        2.5.0-cdh5.3.1
    
    
    

    Please note that some of these dependencies might not be required

提交回复
热议问题