Kaliyug Antagonist
Kaliyug Antagonist

Reputation: 3612

Hive-HBase integration : Table not found

I'm referring to this for Hive-HBase integration.

First, I verified that there is no table named ORDERS_HIVE_DUMMY in HBase :

hbase(main):016:0> describe 'ORDERS_HIVE_DUMMY'

ERROR: Failed to find table named ORDERS_HIVE_DUMMY

Here is some help for this command:
Describe the named table. For example:
  hbase> describe 't1'

Then I started the hive shell :

hduser@cldx-1139-1033:~/hadoop_ecosystem/apache_hive/hive_installation/hive-0.9.0/bin$ ./hive --auxpath $HIVE_HOME/lib/hive-hbase-handler-0.9.0.jar,$HBASE_HOME/hbase-0.94.6.1.jar,$HBASE_HOME/lib/zookeeper-3.4.5.jar,$HIVE_HOME/lib/guava-r09.jar -hiveconf hbase.zookeeper.quorum=cldx-1140-1034
WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
Logging initialized using configuration in jar:file:/home/hduser/hadoop_ecosystem/apache_hive/hive_installation/hive-0.9.0/lib/hive-common-0.9.0.jar!/hive-log4j.properties
Hive history file=/tmp/hduser/hive_job_log_hduser_201304192016_1559705029.txt
hive>

Then, I created a table

hive> CREATE TABLE ORDERS_HIVE_DUMMY(ORDER_ID STRING,CUSTOMER_ID STRING,PRODUCT_ID STRING,ORDER_DATE TIMESTAMP,QUANTITY DOUBLE,AMOUNT DOUBLE,PAYMENT_MODE STRING) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'  WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,ORDER_DETAILS:CUSTOMER_ID,ORDER_DETAILS:PRODUCT_ID,ORDER_DETAILS:REQUEST_DATE,ORDER_DETAILS:PRODUCT_QUANTITY,ORDER_DETAILS:PRICE,ORDER_DETAILS:PAYMENT_MODE");
OK
Time taken: 11.893 seconds

Then, I verified that the table is created in HBase

hbase(main):017:0> describe 'ORDERS_HIVE_DUMMY'
DESCRIPTION                                                                       ENABLED
 {NAME => 'ORDERS_HIVE_DUMMY', FAMILIES => [{NAME => 'ORDER_DETAILS', BLOOMFILTER true
  => 'NONE', REPLICATION_SCOPE => '0', VERSIONS => '3', COMPRESSION => 'NONE', MI
 N_VERSIONS => '0', TTL => '2147483647', BLOCKSIZE => '65536', IN_MEMORY => 'fals
 e', BLOCKCACHE => 'true'}]}

But now when I query the table on Hive, I get an exception :

hive> select * from ORDERS_HIVE_DUMMY;
OK
Failed with exception java.io.IOException:org.apache.hadoop.hbase.TableNotFoundException: orders_hive_dummy
Time taken: 0.455 seconds

I guess that querying external tables requires some hint to the query written on the HIve prompt? What could be the error?

Upvotes: 1

Views: 1117

Answers (1)

mashuai
mashuai

Reputation: 551

the table name in HBase is ORDERS_HIVE_DUMMY but in hive is orders_hive_dummy,so you should use the CREATE TABLE orders_hive_dummy.

Upvotes: 1

Related Questions