Code Repositories
Find and share code repositories
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
New Contributor
Repo Description

Sometimes you want to connect your favorite database query or visualization tool to Hive. I've found that this can be quite cumbersome, typically requiring you to copy jars from the Hadoop cluster to some place locally that can be read by your tool. The goal of this simple maven project is to easily pull the required jars into a single place locally and create an "uber" or "standalone" jar that can be referenced by any JDBC compliant tool.

Binaries can be downloaded here: https://github.com/timveil/hive-jdbc-uber-jar/releases

Updated for HDP 2.5.3 and Kerberos on 12/19/16

Repo Info
Github Repo URL https://github.com/timveil/hive-jdbc-uber-jar
Github account name timveil
Repo name hive-jdbc-uber-jar
5,802 Views
Comments

Thanks @Tim Veil for sharing this. Is it compatiable with HDP 2.4.x?

New Contributor

@Neeraj Sabharwal The jar was just updated for HDP 2.4.2 and supports HDP releases back to 2.2. See this link for all relevant binaries: https://github.com/timveil/hive-jdbc-uber-jar/releases

But we already have the client jar? hive-jdbc-xxx-standalone.jar. I know for some reason they forgot to include two other jars in there but if you copy all three it should work. ( missing is hadoop-commons and commons-logging. )

Would be good to fix the standalone jar to include these two small files as well though.

New Contributor

Thats right. There is a *standalone.jar that ships with hive that should do this but, as you correctly pointed out, does not. This repo works around that problem until it can be properly resolved. In my testing I could not get any of my favorite JDBC clients to work when using the original standalone jar by itself as I was hoping I could. I wanted an easy way to bundle all dependencies into a single jar. I've also made some effort to cleanup the logging dependencies by relying solely on SLF4J and its bindings.

yeah it always worked for me after adding the three jars I mentioned. ( commons-logging, hadoop-common and hive-jdbc ) still annoying thjat you need the other two but not too onerous. Nevertheless your project is cool.

New Contributor

I've updated the "uber" jar with support for HDP 2.5. See https://github.com/timveil/hive-jdbc-uber-jar/releases/tag/v1.0-2.5.0

New Contributor

I tried various options but still getting this error.

Class.forName("org.apache.hive.jdbc.HiveDriver");
Connection con = DriverManager.getConnection("jdbc:hive2://35.168.235.17:2181/default;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2");
Connection con2 = DriverManager.getConnection("jdbc:hive2://35.168.235.17:10000/default

connectString=35.168.235.17:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionState@307f6b8c 2018-01-08 22:47:08,080 INFO [main-SendThread(35.168.235.17:2181)] zookeeper.ClientCnxn (ClientCnxn.java:logStartConnect(975)) - Opening socket connection to server 35.168.235.17/35.168.235.17:2181. Will not attempt to authenticate using SASL (unknown error) 2018-01-08 22:47:23,131 ERROR [main] curator.ConnectionState (ConnectionState.java:checkTimeouts(201)) - Connection timed out for connection string (35.168.235.17:2181) and timeout (15000) / elapsed (15093) org.apache.curator.CuratorConnectionLossException: KeeperErrorCode = ConnectionLoss at org.apache.curator.ConnectionState.checkTimeouts(ConnectionState.java:198) at org.apache.curator.ConnectionState.getZooKeeper(ConnectionState.java:88) at org.apache.curator.CuratorZookeeperClient.getZooKeeper(CuratorZookeeperClient.java:115) at org.apache.curator.framework.imps.CuratorFrameworkImpl.getZooKeeper(CuratorFrameworkImpl.java:474) at org.apache.curator.framework.imps.GetChildrenBuilderImpl$3.call(GetChildrenBuilderImpl.java:214) at org.apache.curator.framework.imps.GetChildrenBuilderImpl$3.call(GetChildrenBuilderImpl.java:203) at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:107) at org.apache.curator.framework.imps.GetChildrenBuilderImpl.pathInForeground(GetChildrenBuilderImpl.java:199) at org.apache.curator.framework.imps.GetChildrenBuilderImpl.forPath(GetChildrenBuilderImpl.java:191) at org.apache.curator.framework.imps.GetChildrenBuilderImpl.forPath(GetChildrenBuilderImpl.java:38) at org.apache.hive.jdbc.ZooKeeperHiveClientHelper.configureConnParams(ZooKeeperHiveClientHelper.java:63) at org.apache.hive.jdbc.Utils.configureConnParams(Utils.java:509) at org.apache.hive.jdbc.Utils.parseURL(Utils.java:429) at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:135) at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:270) at HiveJDBC.main(HiveJDBC.java:15)

Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎05-16-2016 09:05 PM
Updated by:
 
Contributors
Top Kudoed Authors