|
|
-
Hive-Hbase integrationMohammad Tariq 2011-12-17, 18:02
Hello list,
I have a small demo table in Hbase and I want to operate it through Hive.Here is my table in Hbase - hbase(main):021:0> scan 'employee' ROW COLUMN+CELL emp1 column=address:, timestamp=1324119715536, value=#12-bangalore emp1 column=name:, timestamp=1324119698581, value=tariq emp1 column=no:, timestamp=1324119688511, value=001 emp2 column=address:, timestamp=1324120893996, value=#13-bangalore emp2 column=name:, timestamp=1324120883612, value=vishal emp2 column=no:, timestamp=1324120866981, value=002 2 row(s) in 0.0260 seconds I have 2 rows in the employee table, each corresponding to a particular user. And I have 3 column families (each having only 1 column) - no, name and address. For this table I have created an external table in Hive using the following command - hive> CREATE EXTERNAL TABLE employee(key string,no string,name string,address string) > STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' > WITH SERDEPROPERTIES ("hbase.columns.mapping" "no:,name:,address:") > TBLPROPERTIES("hbase.table.name" = "employee"); But i am getting the following error - FAILED: Error in metadata: java.lang.RuntimeException: MetaException(message:org.apache.hadoop.hive.serde2.SerDeException org.apache.hadoop.hive.hbase.HBaseSerDe: hbase column family 'no' should be mapped to Map<String,?> but is mapped to string)FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask Could someone point out my mistake??Also, I would like to know whether the field "key" corresponds to each row in the Hbase table i.e emp1 and emp2 or am I getting the concept wrong??I was going through the wiki, but could not find the proper explanation there.Sorry if my question seems childish. Many thanks. Regards, Mohammad Tariq |