1. 在hbase创建一个表 ivt_mny_pro
2. 在hive创建一个外部表ivt_mny_pro_2_hive
create external table ivt_mny_pro_2_hive(key string, idx bigint, beginTime timestamp, endTime timestamp, userid string)
row format serde 'org.apache.hadoop.hive.hbase.HBaseSerDe'
stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
with serdeproperties("hbase.columns.mapping"=":key, prop:idx, prop:beginTime, prop:endTime, prop:userId")
tblproperties("hbase.table.name"="ivt_mny_pro")
3. 对表进行排序,按照begintime, userid
select * from ivt_mny_pro_2_hive order by begintime, userid;
4. 如果上述步骤可行,则能搞定其他很多事情。
本文介绍如何在HBase中创建表ivt_mny_pro,并通过Hive创建对应的外部表ivt_mny_pro_2_hive以实现数据访问。此外,还演示了如何对表中的数据进行排序。
273

被折叠的 条评论
为什么被折叠?



