Hive集成HBase实践
#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;
"
Hive集成HBase实践的更多相关文章
- Hive集成HBase;安装pig
Hive集成HBase 配置 将hive的lib/中的HBase.jar包用实际安装的Hbase的jar包替换掉 cd /opt/hive/lib/ ls hbase-0.94.2* rm -rf ...
- Hive集成HBase详解
摘要 Hive提供了与HBase的集成,使得能够在HBase表上使用HQL语句进行查询 插入操作以及进行Join和Union等复杂查询 应用场景 1. 将ETL操作的数据存入HBase 2. HB ...
- 大数据技术之_11_HBase学习_02_HBase API 操作 + HBase 与 Hive 集成 + HBase 优化
第6章 HBase API 操作6.1 环境准备6.2 HBase API6.2.1 判断表是否存在6.2.2 抽取获取 Configuration.Connection.Admin 对象的方法以及关 ...
- Hive 集成 Hudi 实践(含代码)| 可能是全网最详细的数据湖系列
公众号后台越来越多人问关于数据湖相关的内容,看来大家对新技术还是很感兴趣的.关于数据湖的资料网络上还是比较少的,特别是实践系列,对于新技术来说,基础的入门文档还是很有必要的,所以这一篇希望能够帮助到想 ...
- hive 集成 hbase NoClassDefFoundError: org/apache/htrace/Trace
更新了hive版本后,在创建hive外部表 级联hbase 的时候报如下异常: hive (default)> create external table weblogs(id string,d ...
- Hortonwork Ambari配置Hive集成Hbase的java开发maven配置
集群环境 ambari 2.7.3 hdp/hortonwork 2.6.0.3 maven <dependency> <groupId>org.apache.hive< ...
- hbase与hive集成:hive读取hbase中数据
1.创建hbase jar包到hive lib目录软连接 hive需要jar包: hive-hbase-handler-0.13.1-cdh5.3.6.jar zookeeper-3.4.5-cdh5 ...
- 集成Hive和HBase
1. MapReduce 用MapReduce将数据从本地文件系统导入到HBase的表中, 比如从HBase中读取一些原始数据后使用MapReduce做数据分析. 结合计算型框架进行计算统计查看HBa ...
- hive和hbase整合的原因和原理
为什么要进行hive和hbase的整合? hive是高延迟.结构化和面向分析的: hbase是低延迟.非结构化和面向编程的. Hive集成Hbase就是为了使用hbase的一些特性.或者说是中和它们的 ...
随机推荐
- N个不同球取出M个的组合个数求解
Technorati 标签: 组合,概率 从N个不同的球中取出M个,一共有多少种取法? 这个问题是组合数据的基本问题,考虑拿出球是否放回,拿出去的球是否有序,它有4种变体: 不放回,有序: 不放回,无 ...
- 一般处理程序获取Layui上传的图片
asp.net利用一般处理程序获取用户上传的图片,上传图片利用的layui 前台页面 <%@ Page Language="C#" AutoEventWireup=" ...
- 【cocos2d-x + Lua(1) 绑定Lua并使用tolua++】
为什么要使用Lua进行游戏开发?转载请注明出处http://www.cnblogs.com/zisou/p/cocos2dx-lua1.html 上面一个问题我觉得在我们使用Lua之前需要深入思考的, ...
- Greedy- 621. Task Scheduler
Given a char array representing tasks CPU need to do. It contains capital letters A to Z where diffe ...
- 四,php异常处理
1,异常处理 异常处理用于在指定的异常或错误发生时,改变脚本的正常执行流程. <?php try{ //错误或异常 }catch (Exception $ex){ //处理异常 //抛出异常 } ...
- 日志分析与splunk浅谈
难易程度:★★★ 阅读点:linux;python;web安全;日志分析; 文章作者:xiaoye 文章来源:i春秋 关键字:网络渗透技术 前言 linux下的日志分析对企业来说非常重要,对我们分析p ...
- java实现fp-growth算法
本文参考韩家炜<数据挖掘-概念与技术>一书第六章,前提条件要理解 apriori算法. 另外一篇写得较好的文章在此推荐: http://hi.baidu.com/nefzpohtpndho ...
- 【wireshark】插件开发(四):Lua插件Post-dissector和Listener
1. Post-dissector post-dissector和dissector不同,它会在所有dissectors都执行过后再被执行,这也就post前缀的由来.post-dissector的构建 ...
- vue复选框选中值获取
<div id="d5"> <p>{{box5.toString()}}</p> <input type="checkbox&q ...
- Swift 里集合类型协议的关系
  Sequence A type that provides sequential, iterated access to its elements. 是最基础的协议,可以通过迭代来获取它的元素 ...