前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Hive集成HBase实践

Hive集成HBase实践

作者头像
云海谷天
发布2022-08-09 14:40:15
3450
发布2022-08-09 14:40:15
举报
文章被收录于专栏:技术一点点成长

#step1: create hive table 't_test' hive -e " create table test.t_user(id int,name string,age int) row format delimited fields terminated by '\t'; "

#step2: prepare dataset and load into hive table 't_test' cat /tmp/t_user.txt ---------------------- 101 Jack 12 102 Michael 18 103 John 21 104 July 20

hive -e " load data local inpath '/tmp/t_user.txt' overwrite into table test.t_user; "

#step3: create hbase mapping table 't_user' echo "create 't_user','i'" | hbase shell

#step4: create external hive table 't_user_hbase' related with hbase table 't_uesr' hive -e " create external table test.t_user_hbase(id int, name string, age int) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ('hbase.columns.mapping' = ':key,i:name,i:age') TBLPROPERTIES('hbase.table.name' = 't_user'); "

#step5: copy data from hive raw table 't_user' to hbase table 't_user' hive -e " insert overwrite table test.t_user_hbase select id,name,age from test.t_user; "

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2018-04-18,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
TDSQL MySQL 版
TDSQL MySQL 版(TDSQL for MySQL)是腾讯打造的一款分布式数据库产品,具备强一致高可用、全球部署架构、分布式水平扩展、高性能、企业级安全等特性,同时提供智能 DBA、自动化运营、监控告警等配套设施,为客户提供完整的分布式数据库解决方案。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档