Connect Hive through Java JDBC

后端 未结 6 658
北海茫月
北海茫月 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:16

    Getting the same error when trying to use hive-jdbc 1.2.1 against hive 0.13. Comparing to the long list in other answers. Now we use these two:

    hive-jdbc-1.2.1-standalone.jar
    hadoop-common-2.7.1.jar
    

    Another side note: you might get 'Required field 'client_protocol' is unset!' when using the latest jdbc against an older Hive. If so, change the jdbc version to 1.1.0:

    
      org.apache.hive
      hive-jdbc
      1.1.0
      standalone
    
    

提交回复
热议问题