Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Connection to hiveserver2 using sqoop

sqoophive2.png

Hi, I would like to connect to Hiveserver2 of my sandbox. But I am facing a problem with the connection string. I have a java exception saying that there is an error when creating database manager as you can see on the joined picture. Can anyone help me with the rigth string?

Thanks!

1 REPLY 1

Super Mentor

@Oriane

Can you please copy the hive-jdbc JARs to the sqoop client directory and then try with the "--driver org.apache.hive.jdbc.HiveDriver" as following:

# cp -f /usr/hdp/current/hive-server2/lib/hive-jdbc.jar /usr/hdp/current/spark-client/lib/

# sqoop list-databases --connect "jdbc:hive2://sandbox.hortonworks.com:10000/default" --driver org.apache.hive.jdbc.HiveDriver

.

All SQL managers does not support the "list-databases" so you might notice the following error while listing databases.

ERROR manager.SqlManager: Generic SqlManager.listDatabases() not implemented.
Could not retrieve database list from server
ERROR tool.ListDatabasesTool: manager.listDatabases() returned null

. So try the following "list-tables" to validate the same.

Example:

# sqoop list-tables --connect "jdbc:hive2://sandbox.hortonworks.com:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2" --driver org.apache.hive.jdbc.HiveDriver --username hive -P 
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.