You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Frank Luo <jl...@merkleinc.com> on 2014/06/20 18:25:18 UTC

need to know how to join tables with datatype of "map"

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!