【发布时间】:2016-10-21 18:26:08
【问题描述】:
我可以创建一个像这样从 hbase 获取数据的 hive 表:
CREATE EXTERNAL TABLE app_store_data
(key string,
type string,
name string,
country string,
price float)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES
("hbase.columns.mapping" = ":key,cf:_type,cf:name, cf:country, cf:price")
TBLPROPERTIES ("hbase.table.name" = "DEBUG_items_app_store");
但是,我的 hbase 表包含两种类型的项目,一种是“应用程序”,另一种是“评论”,一个名为 _type 的键定义了它是哪种类型的项目。我想在 hive 中从同一个 hbase 表创建两个单独的外部表,一个将采用 _type = 'review' 的行,另一个将采用 _type = 'app' 的行。我该怎么做呢?
【问题讨论】: