[
https://issues.apache.org/jira/browse/HIVE-2599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422237#comment-13422237
]
Swarnim Kulkarni commented on HIVE-2599:
----------------------------------------
If your composite keys are delimited by a separator, here is a possible way to
query them in hive:
{noformat}
CREATE EXTERNAL TABLE hbase_table_1(key struct<a:string,b:string,c:string>,
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")
TBLPROPERTIES ("hbase.table.name" = "SIMPLE_TABLE");
{noformat}
Basically what this means is that the composite key here should be mapped to a
struct and we specifying that the keys in the composite key are separated by a
"~". After doing this, querying for the individual keys in the composite keys
should be as simple as:
{noformat}
select key.a,key.b,key.c from hbase_table_1;
{noformat}
> Support Composit/Compound Keys with HBaseStorageHandler
> -------------------------------------------------------
>
> Key: HIVE-2599
> URL: https://issues.apache.org/jira/browse/HIVE-2599
> Project: Hive
> Issue Type: Improvement
> Components: HBase Handler
> Affects Versions: 0.8.0
> Reporter: Hans Uhlig
>
> It would be really nice for hive to be able to understand composite keys from
> an underlying HBase schema. Currently we have to store key fields twice to be
> able to both key and make data available. I noticed John Sichi mentioned in
> HIVE-1228 that this would be a separate issue but I cant find any follow up.
> How feasible is this in the HBaseStorageHandler?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira