我有一张表HBase
,我想将其表示EXTERNAL TABLE
为hive
到目前为止,我一直在使用:
CREATE EXTERNAL TABLE events(key STRING, day INT, source STRING, ip STRING)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping"=":key,c:date#b,c:source,c:ipAddress")
TBLPROPERTIES ("hbase.table.name" = "eventTable");
但是我的查询在我的映射器中没有正确平衡,所以我试图在 ip 地址上进行分区:
CREATE EXTERNAL TABLE events(key STRING, source STRING)
PARTITIONED BY (ip STRING)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping"=":key,c:date#b,c:source,c:ipAddress")
TBLPROPERTIES ("hbase.table.name" = "eventTable");
但我收到有关不正确的列映射的错误:
FAILED: Error in metadata: java.lang.RuntimeException:
MetaException(message:org.apache.hadoop.hive.serde2.SerDeException
org.apache.hadoop.hive.hbase.HBaseSerDe: columns has 2 elements while hbase.columns.mapping has 3 elements (counting the key if implicit))
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
我一直在环顾四周,但找不到任何说明如何在 hbase 列和 hive 分区列之间映射的文档