hive Create Database and Table Statement HIVE_HBASE Integration


Example

Hive-Hbase integration is supported since below versions. Hive: 0.11.0 HBase: 0.94.2 Hadoop: 0.20.2

CREATE TABLE hbase_hive
(id string,
 col1 string,
 col2 string,
 col3 int) 
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES 
("hbase.columns.mapping" = ":key,cf1:col1,cf1:col2,cf1:col3")
TBLPROPERTIES ("hbase.table.name" = "hive_hbase");

Note: 1st column should be the key column.