Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

org.apache.hive.service.cli.HiveSQLException: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/client/Connection

Highlighted

org.apache.hive.service.cli.HiveSQLException: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/client/Connection

New Contributor

Hi,

We installed HDP 2.4.2.0-258 on cluster of 7 nodes, using Ambari 2.2.2.0 on Google cloud machines.

(Hive and HBase are on different hosts)

In our java application when we try to create external table in Hive, we got the following error:

org.apache.hive.service.cli.HiveSQLException: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/client/Connection

Does any one know, what could be the cause of this issue?

Thanks,

David

5 REPLIES 5
Highlighted

Re: org.apache.hive.service.cli.HiveSQLException: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/client/Connection

Explorer

Hi @David M

Can you please post the DDL you have used ?

Highlighted

Re: org.apache.hive.service.cli.HiveSQLException: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/client/Connection

New Contributor

Hi @bmadala

create external table PRODUCTS(key string, PRODUCT_ID DOUBLE, PRODUCT_NAME STRING, LIST_PRICE DOUBLE, PRODUCT_SIZE STRING, CATALOG_URL STRING, PRODUCT_DESCRIPTION STRING, LAST_UPDATE STRING) stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' with serdeproperties ('hbase.columns.mapping' = ':key,PRODUCTS:PRODUCT_ID#b,PRODUCTS:PRODUCT_NAME,PRODUCTS:LIST_PRICE#b,PRODUCTS:PRODUCT_SIZE,PRODUCTS:CATALOG_URL,PRODUCTS:PRODUCT_DESCRIPTION,PRODUCTS:LAST_UPDATE') tblproperties ('hbase.table.name' = 'default:PRODUCTS')
Highlighted

Re: org.apache.hive.service.cli.HiveSQLException: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/client/Connection

Super Guru
@David M

You need HBase client jars for the right version on your client machine where you run this query from. do you have hbase-env.sh on your client machine where you are running this query from? Is HBase_HOME in the classpath?

Highlighted

Re: org.apache.hive.service.cli.HiveSQLException: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/client/Connection

New Contributor

@mqureshi

We run it manually in Hive view in Ambari.

More over Hive and HBase are on different hosts.

Highlighted

Re: org.apache.hive.service.cli.HiveSQLException: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/client/Connection

Super Guru

@David M

On your machine you are running Hive, you need to add hbase jar file to your class path. You also want to make sure that "hbase-site.xml" is the classpath on your machine where you are running hive.

Don't have an account?
Coming from Hortonworks? Activate your account here