I got two hive tables external to two HTables. Because one of HTable has sparse 
columns, I have to use Map as the datatype in Hive for that table. I'd like to 
know how to join two tables.

Here is my sample:
CREATE EXTERNAL TABLE RECORD(RecordID string, BatchDate string, Country string)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,D:BatchDate,D:Country")
TBLPROPERTIES ("hbase.table.name" = "RECORD");


CREATE EXTERNAL TABLE KEY_RECORD(KeyValue String, RecordId map<string,string>)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key, K:")
TBLPROPERTIES ("hbase.table.name" = "KEY_RECORD");

The following join statement doesn't work.

select a.*, b.* from KEY_RECORD a join RECORD b
on a.RecordId[b.RecordID] is not null;

Thx!

Reply via email to