Hive HBase Integration 集成
官方文档:https://cwiki.apache.org/confluence/display/Hive/HBaseIntegration
1、在hive/lib目录下找到hive-hbase-handler-1.2.1.jar,并把该文件拷贝到hbase/lib目录下。
2、把hbase/lib目录下的所有*.jar文件拷贝到hive/lib目录下。
3、在hive的配置文件中 hive-site.xml 增加zookeeper的配置集群信息。
<property>
<name>hbase.zookeeper.quorum</name>
<value>node1,node2,node3</value>
</property>
4、在hive中创建临时表:
CREATE TABLE t_test1
(id int,name string, age string)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,info:name,info:age")
TBLPROPERTIES ("hbase.table.name" = "t_test1","hbase.mapred.output.outputtable" = "t_test1");
HBase表信息:
hbase(main):011:0> describe "t_test1"
测试在hive中插入数据:
hive> insert into t_test1(id,name,age)values(001, 'zs', 'male');
在hbase中同样能查到:
hbase(main):013:0> scan 't_test1'
ROW COLUMN+CELL
1 column=info:age, timestamp=1467337507821, value=male
1 column=info:name, timestamp=1467337507821, value=zs
1 row(s) in 0.3310 seconds
在hbase中插入数据:
hbase(main):015:0> put 't_test1','002','info:age','30'
0 row(s) in 0.0430 seconds
在hive中同样能查到:
hive> select *From t_test1;
OK
2 NULL 30
1 zs male
Time taken: 0.312 seconds, Fetched: 2 row(s)
关联已经存在的hbase表,需要使用external外部表;
应用场景主要针对已经清洗过的数据,放到hbase中,然后通过hql语句根据业务要求将需要的数据提取出来,然后通过sqoop抽取到类似于mysql的数据库中,供展现使用。
Hive HBase Integration 集成的更多相关文章
- 全网最详细的hive-site.xml配置文件里如何添加达到Hive与HBase的集成,即Hive通过这些参数去连接HBase(图文详解)
不多说,直接上干货! 一般,普通的情况是 全网最详细的hive-site.xml配置文件里添加<name>hive.cli.print.header</name>和<na ...
- NoSql存储日志数据之Spring+Logback+Hbase深度集成
NoSql存储日志数据之Spring+Logback+Hbase深度集成 关键词:nosql, spring logback, logback hbase appender 技术框架:spring-d ...
- Centos中hive/hbase/hadoop/mysql实际操作及问题总结
目录 Hive中文乱码问题 hive和hbase的版本不一致 Ambari hive插入Hbase出错 Hive0.12和Hbase0.96不兼容,重新编译hive0.12.0 hiveserver不 ...
- Centos搭建mysql/Hadoop/Hive/Hbase/Sqoop/Pig
目录: 准备工作 Centos安装 mysql Centos安装Hadoop Centos安装hive JDBC远程连接Hive Hbase和hive整合 Centos安装Hbase 准备工作: 配置 ...
- 【原创】大叔问题定位分享(16)spark写数据到hive外部表报错ClassCastException: org.apache.hadoop.hive.hbase.HiveHBaseTableOutputFormat cannot be cast to org.apache.hadoop.hive.ql.io.HiveOutputFormat
spark 2.1.1 spark在写数据到hive外部表(底层数据在hbase中)时会报错 Caused by: java.lang.ClassCastException: org.apache.h ...
- hadoop系列 第二坑: hive hbase关联表问题
关键词: hive创建表卡住了 创建hive和hbase关联表卡住了 其实针对这一问题在info级别的日志下是看出哪里有问题的(为什么只能在debug下才能看见呢,不太理解开发者的想法). 以调试模式 ...
- Hive/hbase/sqoop的基本使用教程~
Hive/hbase/sqoop的基本使用教程~ ###Hbase基本命令start-hbase.sh #启动hbasehbase shell #进入hbase编辑命令 list ...
- Hive/Hbase/Sqoop的安装教程
Hive/Hbase/Sqoop的安装教程 HIVE INSTALL 1.下载安装包:https://mirrors.tuna.tsinghua.edu.cn/apache/hive/hive-2.3 ...
- CDH5上安装Hive,HBase,Impala,Spark等服务
Apache Hadoop的服务的部署比較繁琐.须要手工编辑配置文件.下载依赖包等.Cloudera Manager以GUI的方式的管理CDH集群,提供向导式的安装步骤.因为须要对Hive,HBase ...
随机推荐
- 3D旋转效果
<!doctype html><html lang="en"><head> <meta charset="UTF-8&qu ...
- Strut2开发经验总结
1.如何在html静态页面中使用struts tomcat目录/conf/web.xml 文件中,找到 <servlet-mapping> <servlet-name>jsp& ...
- Retrofit+RxJava(2)-基本使用
首先是抽象的基类 public abstract class BaseApi { public static final String API_SERVER = "服务器地址" p ...
- cmake 基本命令
1 # CMake 最低版本号要求cmake_minimum_required (VERSION 2.8) 2 项目信息project (Demo2) 3 aux_source_directory 查 ...
- leetcode 之 Same Tree
1.题目描述 Given two binary trees, write a function to check if they are the same or not. Two binary tre ...
- 记录今天客户的SQLSERVER启动不起来( 错误9003)的解决过程2013-11-26
记录今天客户的SQLSERVER启动不起来( 错误9003)的解决过程2013-11-26 今天一大早上班就接到客户的电话,说:SQLSERVER启动不起来,业务系统使用不了 于是我就使用QQ远程,帮 ...
- statistical thinking in Python EDA
Histgram直方图适合于单个变量的value分布图形 seaborn在matplotlib基础上做了更高层的抽象,方便对基础的图表绘制.也可以继续使用matplotlib直接绘图,但是调用seab ...
- webservice双向验证
ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtoco ...
- 用华为eNSP模拟器配置Hybrid、Trunk和Access三种链路类型端口
上一篇文章写到三层交换机实现多个VLAN之间互相通讯,有朋友提问要如何进行配置,可有案例分析.其实那天我在写的时候也有做过模拟,只是后来没有保存.今天重新模拟一次,并附上详细配置命令,希望能够帮助到大 ...
- 查询会龄 sql部分
AND ( case when ${fld:vc_age} = '1' then ((current_date-d.c_idate::date)/30)<3 when ...