- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to Do I get the Hive JDBC Driver for My Client
- Labels:
-
Apache Hive
Created 10-03-2015 12:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to use SquirrelSQL or Oracle SQL Developer or another SQL tool to connect to Hive via JDBC. Where do I find the Hive JDBC Client?
Created 10-03-2015 01:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@dstreever@hortonworks.com has a nice write up on this, including a script that pulls together the needed jars, on his wiki at https://streever.atlassian.net/wiki/x/DABD.
Created 10-03-2015 12:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FOR HDP 2.2.x From /usr/hdp/current/hive-client/lib/ sftp or scp to your local desktop
- hive-*-0.14*.jar
- httpclient-4.2.5.jar
- httpcore-4.2.5.jar
- libthrift-0.9.0.jar
- libfb303-0.9.0.jar
- commons-logging-1.1.3.jar
FOR HDP 2.3.x
From /usr/hdp/current/hive-client/lib/ sftp or scp to your local desktop
- hive-jdbc.jar
FOR BOTH
From /usr/hdp/current/hadoop-client
- hadoop-common.jar
- hadoop-auth.jar
From /usr/hdp/current/hadoop-client/lib
- log4j-1.2.17.jar
- slf4j-*.jar
Download SquirrelSQL from sourceforge.net
http://squirrel-sql.sourceforge.net/
Configure Hive Driver in Squirrel SQL
- Select ‘Drivers -> New Driver…’ to register the Hive JDBC driver.
- Enter Hive for Driver Name and jdbc:// Example URL: jdbc:hive://localhost:10000/default
- Select ‘Extra Class Path -> Add’ to add the jars you copied from the previous steps.
- Enter org.apache.hive.jdbc.HiveDriver as Class Name
Add a New Hive Connection Alias for HDP 2.3
- Choose Alias -> New Alias
- Enter “Hive for HDP 2.3”
- Enter “jdbc:hive2://1270.0.1:10000”
- Enter “hive” for User Name and “hive” for Password.
- Test your connection and ensure it is successful
- Connect to “Hive for HDP 2.3.” alias. If successful you would be presented with the default and xademo databases.
Oracle SQL Developer and Toad for Apache Hadoop does not use Apache Hive JDBC Driver. They are both black boxes that hide the the ability to easily point to a JDBC class path and just end whatever JDBC properties you desire.
So if you need to add special properties for ssl, or kerberos or ldap authentication, neither SQL Developer nor Toad will work.
Use SQL Workbench J, RazorSQL or Squirrel SQL instead.
Created 10-03-2015 01:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@dstreever@hortonworks.com has a nice write up on this, including a script that pulls together the needed jars, on his wiki at https://streever.atlassian.net/wiki/x/DABD.
Created on 02-16-2016 08:45 PM - edited 08-19-2019 05:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have tested this and this is the best/easy way to configure the connection
Created 10-05-2015 05:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Starting with Hive 0.14, there is a standalone jar that contains most of the necessary binaries. It still currently requires two additional jars until HIVE-9600 is resolved:
- hive-jdbc-<version>-standalone.jar
- hadoop-common.jar
- hadoop-auth.jar
See http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.0/bk_dataintegration/content/hive-jdbc-odbc-dr... for details.
Created 04-25-2016 02:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have HDP 2.3 sandbox in my server, I followed you instruction to setup the connection for squirrel sql, I got under exception:
java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:206) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:175) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104) ... 5 more Caused by: java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration at org.apache.hive.jdbc.HiveConnection.createUnderlyingTransport(HiveConnection.java:418) at org.apache.hive.jdbc.HiveConnection.createBinaryTransport(HiveConnection.java:438) at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:179) at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:152) at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107) at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167) ... 7 more Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.conf.Configuration at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 14 more
can you please help?
Thanks
Created 05-18-2016 01:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Ancil McBarnett check out the repo i've been maintianing that uses maven to pull the required jars.
https://community.hortonworks.com/repos/33592/hive-jdbc-uber-jar.html
