Apache Hive JDBC 驱动程序在哪里下载? [英] Where is Apache Hive JDBC driver for download?

查看:68
本文介绍了Apache Hive JDBC 驱动程序在哪里下载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过 JDBC 从 Java 程序连接到 Hive.我搜索了谷歌,找到了许多这样的指南和例子:HiveServer2 客户端

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 驱动程序本身(jar 文件).Cloudera上好像有jar文件可以下载,不过需要注册.

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.

有谁知道从哪里获得普通的 Apache Hive JDBC 驱动程序本身?

Does anyone know where to get the plain Apache Hive JDBC driver itself ?

推荐答案

如果您的程序在所有 Hadoop 库已安装的主机上运行,​​则使用 Apache 驱动程序是没问题的.否则,您将不得不拖拽一大堆依赖,即

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.

  • hive-jdbc*-standalone.jar (大的)
  • hadoop-common*.jar
  • hadoop-auth*.jar (仅适用于 Kerberos)
  • commons-configuration*.jar
  • SLF4J 的家人和朋友

将所有这些依赖项打包在您自己的 JAR 中可能会导致大量杂乱的软件(天啊,现在 Maven 是如何被滥用的).此外,您可能会遇到兼容性问题,因为较新的客户端与较旧的服务器不兼容.不兼容"意味着无法初始化与 Thrift 服务器的连接".

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".

对于独立安装,Cloudera 驱动程序可能是一个不错的解决方案 - 注册只是意味着留下一封垃圾"电子邮件以获取一些营销信息(然后您可以取消订阅).虽然我承认我从未在非 Cloudera 集群上使用过它.

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.

这篇关于Apache Hive JDBC 驱动程序在哪里下载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆