hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bejoy Ks <>
Subject Re: Composite Key Handling in Hbase + Hive Integration
Date Tue, 24 Jul 2012 10:04:23 GMT
Hi Ankit

Have you tried using UDFs to extract the required value?
Something like


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);

Bejoy KS

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


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 :

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 : which
talks about similar feature.

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

Ankit Kinra
View raw message