Re: Composite Key Handling in Hbase + Hive Integration

2012-07-24 Thread ankit kinra
Hi swarnim , Yes that workaround worked for me perfectly, but hive was having problems reading the bytes of the first key (first part of key) which was a Long stored as bytes using Bytes.toBytes(Long) of Hbase. I tried using BIGINT for the part of the key but it did not work. I guess I will searc

Re: Composite Key Handling in Hbase + Hive Integration

2012-07-24 Thread kulkarni.swar...@gmail.com
Try something like this: CREATE EXTERNAL TABLE hbase_table_1(key struct, value string) ROW FORMAT DELIMITED COLLECTION ITEMS TERMINATED BY '~' STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,test-family:test-qual") TBLPROPERTI

Re: Composite Key Handling in Hbase + Hive Integration

2012-07-24 Thread Bejoy Ks
Hi Ankit Have you tried using UDFs to extract the required value? Something like substring(key,0,instr(key,'~')-1) say SELECT substring(key,0,instr(key,'~')-1) from hbasetest; SELECT substring(key,0,instr(key,'~')-1) from hbasetest GROUP BY substring(key,0,instr(key,'~')-1); Regards Bejoy KS