Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Tried one sample of handling a table in hbase from hive.

The CREATE EXTERNAL TABLE command was successful, but the select statement gives a class cast exception

ENV: hive 0.12.0, hbase 0.96.1, hadoop 2.2 , Ubuntu 12.04 on Virtual box

hive> SHOW TABLES;                                                                   
OK
hbatablese_myhive
Time taken: 0.309 seconds, Fetched: 1 row(s)
hive> SELECT * FROM hbatablese_myhive;
OK

**Failed with exception

java.io.IOException:java.lang.ClassCastException: org.apache.hadoop.hbase.client.Result cannot be cast to org.apache.hadoop.io.Writable**
Time taken: 1.179 seconds

hive> 

The same table on HBASE console:

hbase(main):002:0> scan 'myhive'
ROW                                   COLUMN+CELL                                                                                           



 row1                                 column=ratings:userid, timestamp=1392886585074, value=user1                                               
 row2                                 column=ratings:userid, timestamp=1392886606457, value=user2                                               
2 row(s) in 0.0520 seconds
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.