hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Luo <j...@merkleinc.com>
Subject need to know how to join tables with datatype of "map"
Date Fri, 20 Jun 2014 16:25:18 GMT
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!

Mime
View raw message