标签:实现 ping mic app image 外部表 int 图片 pre
Hive整合HBase:数据实时写Hbase,实现在Hive中用sql查询以下操作的 Hive版本:2.3.6 ,HBase版本:2.0.4
在HBase中创建表:t_hbase_stu_info
create ‘t_hbase_stu_info‘,‘st1‘
在Hive中创建外部表:t_hive_stu_info
create external table t_hive_stu_info
(id int,name string,age int,sex string)
stored by ‘org.apache.hadoop.hive.hbase.HBaseStorageHandler‘
with serdeproperties("hbase.columns.mapping"=":key,st1:name,st1:age,st1:sex")
tblproperties("hbase.table.name"="t_hbase_stu_info");
put ‘t_hbase_stu_info‘,‘1001‘,‘st1:name‘,‘zs‘
put ‘t_hbase_stu_info‘,‘1001‘,‘st1:age‘,‘23‘
put ‘t_hbase_stu_info‘,‘1001‘,‘st1:sex‘,‘man‘
put ‘t_hbase_stu_info‘,‘1002‘,‘st1:name‘,‘ls‘
put ‘t_hbase_stu_info‘,‘1002‘,‘st1:age‘,‘56‘
put ‘t_hbase_stu_info‘,‘1002‘,‘st1:sex‘,‘woman‘
scan ‘t_hbase_stu_info‘
select * from t_hive_stu_info;
标签:实现 ping mic app image 外部表 int 图片 pre
原文地址:https://blog.51cto.com/simplelife/2483754