Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive >> mail # user >> Hive-Hbase integration


+
Mohammad Tariq 2011-12-01, 12:19
Copy link to this message
-
Hive-Hbase integration
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
+
Bejoy Ks 2011-12-17, 19:05
+
Mohammad Tariq 2011-12-17, 20:39
+
Savant, Keshav 2012-02-28, 12:28
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB