Pivotal Knowledge Base


Hive query fails with java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/mapreduce/TableInputFormatBase


Executing a Hive query against a hive external table pulling data from HBase can fail with the below error message indicating TableInputFormatBase class not found.

hive> CREATE EXTERNAL TABLE hive_hbase_table(key string, value string,value1 string) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf:foo,cf:message") TBLPROPERTIES ("hbase.table.name" = "mytable");
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. org/apache/hadoop/hbase/mapreduce/TableInputFormatBase


If hbaser-server.jar library is missing from hive classpath, you will observe this error.


Add HIVE_AUX_JARS_PATH to include hbase libraries in /etc/gphd/hive/conf/hive-env.sh

export HIVE_AUX_JARS_PATH="/usr/lib/gphd/hbase/lib/" 

Restart Hive server and metastore

In Pivotal HD cluster, you will need to use icm_client to reconfigure and push the updated hive-env.sh files on the cluster. Please refer to pivotal hadoop documentation to review the steps to reconfigure the cluster.


Internal employee reference: HD-10920


Powered by Zendesk