2013年8月9日星期五

HIVE and HBASE data Butt

There is a table in Hbase TB_1
FNAME: "C1
Subsequently, in the Hive created a mapping table TB_1
When HBASE data is changed , Hive can be read to HIVE
But I go to insert new data , HBASE actually do not see , the solution ~ ~
------ Solution ---------------- ----------------------------


HIVE of mapping table can not be updated in HBASE existing data table
create a mapping table , while creating HBASE docking table

--Hive SHELL
--创建HIVE和HBASE表单
CREATE TABLE hbase_table(key int, value string) 
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' 
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,_0:val") 
TBLPROPERTIES ("hbase.table.name" = "hive_table");

--插入测试数据
insert overwrite table hbase_table select key as key,'00' as Test from OtherHivetb;

--HBASE SHELL
scan 'hive_table',{LIMIT=>1};

------ For reference only ----------------------------------- ----
Thank you, understand

没有评论:

发表评论