【问题标题】:[Hive HBase Integration],when create hive table which supports auto inport data to hbase table ,how to set property "hbase.columns.mapping" value?[Hive HBase 集成],创建支持自动导入数据到hbase 表的hive 表时,如何设置属性“hbase.columns.mapping”值?
【发布时间】:2017-02-14 09:34:16
【问题描述】:

创建表 hbase_table_1 (键 int,value1 字符串,value2 int,value3 int) 存储者 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' 和 SERDE属性 ( "hbase.columns.mapping" = ":key,a:b,a:c,d:e" );

插入覆盖表 hbase_table_1 SELECT foo, bar, foo+1, foo+2 从 戳 WHERE foo=98 OR foo=100;

我是 hbase 和 hive 的新手?当我想从 hive 自动导入数据到 hbase 时, 在官网找到这个页面[https://cwiki.apache.org/confluence/display/Hive/HBaseIntegration]

这是 apache 示例!我无法理解此属性的值? 谁能给我解释一下???

我想知道如何设置这个属性的值!

谢谢

【问题讨论】:

  • 属性值只不过是将 hbase 表列映射到 hive 列。在 Hbase 中,它的所有列都是面向的。在 hive 中,它是面向行的。你需要在 hive 中指定 hbase 的哪一列在蜂巢中映射。
  • 我已经在 stackoverflow 中搜索了答案..但还是谢谢

标签: hive hbase


【解决方案1】:

Create Hive Integrated Hbase Table:

hive -e "INSERT OVERWRITE TABLE hivedbnm.hivehbasetblnm 
SELECT * FROM hivedbnm.temphivetable;"

CREATE TABLE ${hiveconf:hivedbnm}.hivehbasetblnm (
key string, C1 decimal(10,4))
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf1:C1")
TBLPROPERTIES ("hbase.table.name" = "hbasetblnm", "hbase.mapred.output.outputtable" = "hbasetblnm");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多