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.

Configuring HBASE to permit Hive to query

Configuring HBASE to permit Hive to query

Explorer

Cloudera Mgr: 4.8.1

Using Parcels

CDH v 4.3.1

 

 

I've tried to get hive to communicate with hbase.

 

I used the following query:

 

ADD JAR /opt/cloudera/parcels/CDH/lib/zookeeper/zookeeper.jar
ADD JAR /opt/cloudera/parcels/CDH/lib/hbase/hbase.jar
ADD JAR /opt/cloudera/parcels/CDH/lib/hive/lib/hive-hbase-handler-0.10.0-cdh4.3.0.jar
ADD JAR /opt/cloudera/parcels/CDH/lib/hive/lib/guava-11.0.2.jar

CREATE EXTERNAL TABLE IF NOT EXISTS default.test (
key STRING,
col2 STRING,
col3 STRING)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES (
"hbase.columns.mapping" =
":key,cf:col2,cf:col3")
TBLPROPERTIES("hbase.table.name" = "test");

 

when I run it, I get this:

 

hive -f test.hql
Logging initialized using configuration in jar:file:/opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/lib/hive/lib/hive-common-0.10.0-cdh4.3.0.jar!/hive-log4j.properties
Hive history file=/tmp/jhendric/hive_job_log_2826df5d-962f-4727-b6a3-9fdfd3fcb6a7_215719674.txt
Added /opt/cloudera/parcels/CDH/lib/zookeeper/zookeeper.jar to class path
Added resource: /opt/cloudera/parcels/CDH/lib/zookeeper/zookeeper.jar
ADD does not exist
Query returned non-zero code: 1, cause: ADD does not exist.

 

The jars are indeed in the locations I entered. I verified that.

 

I even added a property to hive-site.xml

 

<property>
<name>hive.aux.jars.path </name>
<value>file:///opt/cloudera/parcels/CDH/lib/hive/lib/zookeeper.jar,file:///opt/cloudera/parcels/CDH/lib/hive/lib/hive-hbase-handler-0.10.0-cdh4.3.0.jar,file:///opt/cloudera/parcels/CDH/lib/hive/lib/guava-11.0.2.jar,file:///opt/cloudera/parcels/CDH/lib/hive/lib/hbase.jar</value>
</property>

 

When run the hive query without adding the jar files the second time because they are in the hive-site.xml file, The query just hangs.

 

 

Is there some configuration I need to do to HBASE other than the default config that the Cloudera Mgr installs?

 

Any idea why the files are not being seen by hive?

 

Jim

 

1 REPLY 1
Highlighted

Re: Configuring HBASE to permit Hive to query

Master Guru
Your problem isn't configuration or a bug, but rather that the ADD statements require trailing semicolons (;) but you have not provided them.

This is causing the statement to go look for a file called 'ADD' as its command wraps onto the next line.