HIVE+HBASE integration error

367 views
Skip to first unread message

Sivaji

unread,
Jul 14, 2013, 5:52:28 AM7/14/13
to chenn...@googlegroups.com
hive> create table hbaseview(key string,val int) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,cf:id,cf:name");
FAILED: Error in metadata: java.lang.RuntimeException: MetaException(message:org.apache.hadoop.hive.serde2.SerDeException org.apache.hadoop.hive.hbase.HBaseSerDe: columns has 2 elements while hbase.columns.mapping has 3 elements (counting the key if implicit))
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask


i am getting the above error while integrating the hbase with hive, columns are different how to solve it..?
  Thank you.

kasaragadda srinivasarao

unread,
Jul 15, 2013, 9:33:04 AM7/15/13
to chenn...@googlegroups.com
Hi sivaji,

Hive table coumns and hbase columas tables are not matching.  you are trying to create hive table with 2 coulmns but in hbase table you have 3 columns. And one mire thing is specify the hbase table name.

try the Following query format


CREATE TABLE hbase_stocks(key INT, name STRING, price FLOAT)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,stock:val")
TBLPROPERTIES ("hbase.table.name" = "stocks");

If this query also not working then try with external table option
Reply all
Reply to author
Forward
0 new messages