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



________________________________
 From: ankit kinra <[email protected]>
To: [email protected] 
Sent: Tuesday, July 24, 2012 12:44 PM
Subject: Composite Key Handling in Hbase + Hive Integration
 

Hi,

I have a use case in HBase + Hive Integration where HBase primary key is a 
composite key and the keys is separated by us with a custom delimiter. So 
basically it is Key = A~B~C.
Now, I wanted to run a query on this HBase table using Hive and group by "A" 
(and not the complete primary key). I went through the following presentation : 
https://docs.google.com/viewer?a=v&q=cache:GHg9GMFOZVwJ:assets.en.oreilly.com/1/event/61/HBase%2520and%2520Hive%2520at%2520StumbleUpon%2520Presentation.ppt+hbase+composite+key+hive&hl=en&gl=us&pid=bl&srcid=ADGEEShTyoUXyvXptTu4pMjje_FkaN_j1OK9wG0lclWWsKNjGreLTkk3IDqT16xO8ClqIfzhM69aeU7Gph4kZPxTS-PXvLiWPSRvgS2WEjnvViPJhpM0ItsLaTWq1DRuUgOzKhjSzIlx&sig=AHIEtbT4scO3IdtvLYG3RtLoKN5gG1udPg

It says that this was implemented at StumbleUpon, anybody having any idea if 
that can be used by others.

Also, there is this issue in JIRA 
: https://issues.apache.org/jira/browse/HIVE-2599 which talks about similar 
feature.

So it would be very helpful if anyone can give me some idea regarding this.


Regards,
Ankit Kinra

Reply via email to