Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Connecting to Hive from SquirreL SQL client

avatar
Super Collaborator

@Ned Shawa

I followed these steps, but still unable to connect:

https://community.hortonworks.com/articles/3043/connecting-to-hive-thrift-server-on-hortonworks-us.h...

I did following:

1. Copied all required jar files from the cluster to Squirrel lib directory:

commons-logging*.jar

hadoop-common-*.jar

hive-exec-*.jar

hive-jdbc-*.jar

httpclient-*.jar

httpcore-*.jar

libthrift-*.jar

ojdbc7.jar

sfl4j-api-*.jar

sfl4j-log4j12-*.jar

2. Created a new driver using above jar files.

3. Created a new alias using the new driver with following URL: jdbc:hive2://<HiveServer2 SERVER>:10000/default

UserName: <Hive Oracle User Name>

Password: <Hive Oracle Password>

Still, I'm seeing following error:

===========================================================

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/hadoop/hive/metastore/api/MetaException at java.util.concurrent.FutureTask.report(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown Source) 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(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/hadoop/hive/metastore/api/MetaException 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/hive/metastore/api/MetaException at org.apache.hive.jdbc.HiveConnection.createBinaryTransport(HiveConnection.java:456) at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:182) at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:155) at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105) 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.hive.metastore.api.MetaException at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 13 more

1 ACCEPTED SOLUTION

avatar
Expert Contributor

@Manish Gupta try adding hive-metastore.jar as well in squirrel jar list.

View solution in original post

4 REPLIES 4

avatar
Expert Contributor

@Manish Gupta try adding hive-metastore.jar as well in squirrel jar list.

avatar
Master Guru

That is exactly why I rather use ambari views

avatar
Super Collaborator

Thanks @Kashif Khan.

avatar
New Contributor

I do have similar issue to connect hive from squirrel

i use the Beeline version 3.1.0.3.0.1.0-187 by connecting Hortonworks Image thru VM

 

Here are the jars added ,but I am having connection got refused with error

"Unexpected Error occurred attempting to open an SQL connection.class java.net.ConnectException: Connection refused: connect"

 

hive-jdbc-3.1.0.3.0.1.0-187.jar

hive-jdbc-3.1.0.3.0.1.0-187-sources.jar

hive-jdbc-3.1.0.3.0.1.0-187-standalone.jar

 

Jdbc URL

jdbc:hive2://sandbox-hdp.hortonworks.com:2181/default

 

Any idea how to fix?