Java Apache Hive JDBC 驱动程序在哪里下载?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36005061/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where is Apache Hive JDBC driver for download?
提问by user1021712
I need to connect to Hive from Java program via JDBC. I searched google and found numerous guides and examples like this: HiveServer2 clients
我需要通过 JDBC 从 Java 程序连接到 Hive。我搜索了谷歌并找到了许多这样的指南和示例: HiveServer2 clients
However, I could not find the JDBC driver itself (jar file) anywhere. There seem to be a jar file for download from Cloudera, but it requires registration.
但是,我在任何地方都找不到 JDBC 驱动程序本身(jar 文件)。好像有一个jar文件可以从Cloudera下载,但是需要注册。
Does anyone know where to get the plain Apache Hive JDBC driver itself ?
有谁知道从哪里获得普通的 Apache Hive JDBC 驱动程序本身?
回答by Boris Pavlovi?
Add this dependency to your Maven pom:
将此依赖项添加到您的 Maven pom:
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-jdbc</artifactId>
<version>2.0.0</version>
</dependency>
The jar can be downloaded from: http://central.maven.org/maven2/org/apache/hive/hive-jdbc/2.0.0/hive-jdbc-2.0.0.jar
jar 可以从以下位置下载:http: //central.maven.org/maven2/org/apache/hive/hive-jdbc/2.0.0/hive-jdbc-2.0.0.jar
Complete list of versions: http://www.mvnrepository.com/artifact/org.apache.hive/hive-jdbc
完整的版本列表:http: //www.mvnrepository.com/artifact/org.apache.hive/hive-jdbc
回答by Noor
You can download the driver from here.Download hive-jdbc-0.10.0.jar
您可以从这里下载驱动程序。下载 hive-jdbc-0.10.0.jar
回答by Samson Scharfrichter
Using the Apache driver is fine if your program runs on a host with all the Hadoop libs already installed. Otherwise you will have to drag a smorgasbord of dependencies i.e.
如果您的程序在已安装所有 Hadoop 库的主机上运行,则可以使用 Apache 驱动程序。否则你将不得不拖着一大堆依赖,即
- hive-jdbc*-standalone.jar (the large one)
- hadoop-common*.jar
- hadoop-auth*.jar (for Kerberos only)
- commons-configuration*.jar
- the SLF4J family and friends
- hive-jdbc*-standalone.jar (大的)
- hadoop-common*.jar
- hadoop-auth*.jar (仅适用于 Kerberos)
- 公共配置*.jar
- SLF4J 的家人和朋友
Packaging all these dependencies in your own JAR will probably result in a massive, cluttered piece of shoftware (God, how Maven is misused nowadays). Plus, you may have compatibility issue because newer clients are not compatible with older servers. "Not compatible" meaning "unable to initialize connection with Thrift server".
将所有这些依赖项打包在您自己的 JAR 中可能会导致大量杂乱的软件(上帝,现在如何滥用 Maven)。另外,您可能会遇到兼容性问题,因为较新的客户端与较旧的服务器不兼容。“不兼容”意味着“无法初始化与 Thrift 服务器的连接”。
For a standalone install the Cloudera driver may be a good solution - registration just means leaving one of your "junk" e-mails to get a couple of marketing messages (and you can un-subscribe then). Although I admit I've never used it on a non-Cloudera cluster.
对于独立安装,Cloudera 驱动程序可能是一个很好的解决方案 - 注册只是意味着留下一封“垃圾”电子邮件以获取一些营销信息(然后您可以取消订阅)。尽管我承认我从未在非 Cloudera 集群上使用过它。
回答by Thomas Decaux
You can download an uber jar here:
您可以在此处下载 uber jar:
https://github.com/timveil/hive-jdbc-uber-jar/releases
https://github.com/timveil/hive-jdbc-uber-jar/releases
Works straightaway.
直接工作。