Support Questions

Find answers, ask questions, and share your expertise

"Using Hive with HBase" documentation is missing a jar file

avatar
Contributor

The "Using Hive with HBase", linked here, contains the following instructions:

 

To allow Hive scripts to use HBase, add the following statements to the top of each script. Replace the <component_version> strings with current version numbers for CDH, Guava and the Hive HBase handler....

ADD JAR /usr/lib/hive/lib/zookeeper.jar;
ADD JAR /usr/lib/hive/lib/hive-hbase-handler-<Hive-HBase-Handler_version>-cdh<CDH_version>.jar
ADD JAR /usr/lib/hive/lib/guava-<Guava_version>.jar;

For example,

ADD JAR /usr/lib/hive/lib/zookeeper.jar;
ADD JAR /usr/lib/hive/lib/hive-hbase-handler-0.10.0-cdh4.4.0.jar
ADD JAR /usr/lib/hive/lib/guava-11.0.2.jar;

 

However, when issuing a INSERT OVERWRITE TABLE hbase_table ... command in hive, I received the following error:

 

Error: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.mapreduce.TableInputFormatBase

 

This was fixed by adding the following jar in addition to the above jars:

 

ADD JAR /usr/lib/hive/lib/hbase.jar

 

And I think you should also point out the fact that people using Hive with HBase don't need to issue the ADD JAR command at the begining of every single script; all they need to do is edit the hive-site.xml file on each node they execute Hive from and include the following property:

 

<property>
  <name>hive.aux.jars.path</name>
  <value>file:///usr/lib/hive/lib/zookeeper.jar,file:///usr/lib/hive/lib/hive-hbase-handler-0.10.0-cdh4.5.0.jar,file:///usr/lib/hive/lib/guava-11.0.2.jar,file:///usr/lib/hive/lib/hbase.jar</value>
</property>

 

 

 

 

1 ACCEPTED SOLUTION

avatar
Guru

Thanks for the feedback, I will file a JIRA with our docs team to have this updated.

 

Much appreciated!

View solution in original post

1 REPLY 1

avatar
Guru

Thanks for the feedback, I will file a JIRA with our docs team to have this updated.

 

Much appreciated!