You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Manuel Vellon <ma...@level11.com> on 2013/09/28 00:04:16 UTC
Problem with Hive JDBC + HBase
I am getting an error when using the Hive JDBC driver:
java.lang.NoSuchMethodError: org.apache.thrift.EncodingUtils.setBit(BIZ)B
I've seen several messages suggesting that this is a problem due to different thrift jars in hbase and hive. To avoid this problem, I copied the Hive thrift jar (libthrift-0.9.0.jar) into the hbase/lib directory (and verified, with ps, that it's being picked up in the class path.) Alas, I still get the error.
Individually, Hadoop, HBase and Hive all run fine.
The ps output does not show any other java process using any other =
version of libthrift.
Here are the versions that I'm using:
hadoop: 1.2.1
hbase: 0.94.12
hive: 0.10.0
The code that triggers the problem is simple:
Class.forName("org.apache.hadoop.hive.jdbc.HiveDriver");
Connection con = DriverManager.getConnection("jdbc:hive://127.0.0.1:10000/default", "", "");
Statement stmt = con.createStatement();
ResultSet res = stmt.executeQuery("show tables");
// code blows up on next statement
while(res.next())
{
String str = res.getString(0);
System.out.println(str);
}
res.close();
stmt.close();
con.close();
The abbreviated stack trace looks like:
java.lang.NoSuchMethodError: org.apache.thrift.EncodingUtils.setBit(BIZ)B
at org.apache.hadoop.hive.service.ThriftHive$fetchN_args.setNumRowsIsSet(ThriftHive.java:2401)
at org.apache.hadoop.hive.service.ThriftHive$fetchN_args.setNumRows(ThriftHive.java:2388)
at org.apache.hadoop.hive.service.ThriftHive$Client.send_fetchN(ThriftHive.java:157)
at org.apache.hadoop.hive.service.ThriftHive$Client.fetchN(ThriftHive.java:150)
at org.apache.hadoop.hive.jdbc.HiveQueryResultSet.next(HiveQueryResultSet.java:138)
Any clues as to what I should try next would be appreciated.