hive → phoenix数据导入导出方案
来源:互联网 发布:螨虫与痘痘的知乎 编辑:程序博客网 时间:2024/06/17 12:19
主要是使用Phoenix Storage Handler for Apache Hive Feature Installation,优势是phoenix自带的feature,支持力度比较好
phoenix主页上相关的介绍[https://phoenix.apache.org/hive_storage_handler.html ]
1. 调研的环境
phoenix 4.8
hive 1.2.1
测试环境共有两个集群。 hbase和hadoop
2. 操作过程
2.1 需要开启的配置项
hbase-site.xml 集群和客户端都需要开启这两项配置
<property> <name>phoenix.schema.isNamespaceMappingEnabled</name> <value>true</value></property><property> <name>phoenix.schema.mapSystemTablesToNamespace</name> <value>false</value></property>
hive-site.xml
<property> <name>hive.aux.jars.path</name> <value>file:///home/hadoop/apache-hive-1.2.1-bin/lib/phoenix-4.8.0-HBase-0.98-hive.jar</value></property>
hive-env.sh
export HIVE_AUX_JARS_PATH=/home/hadoop/apache-hive-1.2.1-bin/lib/phoenix-4.8.0-HBase-0.98-hive.jar
2.2 创建phoenix schema
create schema if not exists ABC;
2.3 创建hive内部表,关联到phoenix
create table g_order_phoenix ( order_id bigint, driver_id bigint, driver_phone string, passenger_id bigint )STORED BY 'org.apache.phoenix.hive.PhoenixStorageHandler' TBLPROPERTIES ("phoenix.table.name" = "ABC.G_ORDER_PHOENIX","phoenix.zookeeper.quorum" = "10.93.18.30,10.93.18.31,10.93.18.32","phoenix.zookeeper.znode.parent" = "/hbase","phoenix.zookeeper.client.port" = "2181","phoenix.rowkeys" = "order_id,driver_id","phoenix.column.mapping" = "order_id:order_id, driver_id:driver_id, driver_phone:driver_phone, passenger_id:passenger_id","phoenix.table.options" = "SALT_BUCKETS=10, DATA_BLOCK_ENCODING='DIFF'");
###2.4 创建待导出数据的hive表,这部分数据在hadoop HDFS上
CREATE TABLE `g_order`( `order_id` bigint COMMENT '订单id', `driver_id` bigint COMMENT '司机id,司机抢单前该值为0', `driver_phone` string COMMENT '司机电话', `passenger_id` bigint COMMENT '乘客id' );
2.5 插入数据
insert into table g_order select order_id, driver_id,driver_phone,passenger_id from g_order_phoenix where driver_id!=0 and order_id!=0;
0 0
- hive → phoenix数据导入导出方案
- Hive 导入导出数据
- hive数据导入导出
- hive 导入导出数据
- hive导入导出数据
- hive导入/导出数据
- Hive数据导入和导出
- hive导入和导出数据
- Hive数据导入和导出
- hive导入导出数据案例
- hive 数据的导入导出
- Hive 之 导入导出数据
- hive&&beeline 数据导入导出
- Hive数据导入、sqoop数据导入导出
- Phoenix Framework 测试用例及数据导入导出模块
- Hive的数据导入导出,插入,加载
- Hive常用数据导入导出总结
- HIVE入门_3_数据导入导出
- 2017移动互联网寒冬(Android)求职随感
- 一些图片过渡特效(C/C++)
- java零基础的外行人之(一) JAVA开发环境,基本类型,运算符
- LeetCode题解–46. Permutations
- 2016年11月起的新版Raspbian系统putty连接失败:Network error:Connection refused解决办法
- hive → phoenix数据导入导出方案
- 链表C++实现
- 把VIM打造成python开发环境
- jeecms 利用hover生成下拉菜单
- 图片解码播放器2
- ViewPager懒加载分析推荐
- 关于复杂语句和++的优先级
- ELK日志处理之使用logstash收集log4J日志
- Git-本地提交及远程提交