-
hive hbase 映射表
2017-12-06 14:50:491)创建表 create 'hive_table','json' 2) 插入了数据如下 hbase(main):012:0> scan 'hive_htable' ROW COLUMN+CELL1)创建表
create 'hive_table','json'
2) 插入了数据如下
hbase(main):012:0> scan 'hive_htable'
ROW COLUMN+CELL
1 column=json:age, timestamp=1512540521663, value=18
1 column=json:frend, timestamp=1512540630352, value=[{"relationship":1,"phone":"15******7","realName":"addr1"},{"relationship":11,"phone":"13********6","realName":"addr2"}]1 column=json:name, timestamp=1512540375713, value=yinchunguang
3)创建hive表
create external table hbase_test (key string ,age string ,name string ,frend string) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,json:age,json:name,json:frend")TBLPROPERTIES ("hbase.table.name" = "hive_htable");
4) hive 查询
hive> select * from hbase_test;
OK
1 18 yinchunguang [{"relationship":1,"phone":"15835809207","realName":"addr1"},{"relationship":11,"phone":"13353588520","realName":"addr2"}]到此可以进行hive sql on hbase了。
但是presto => hive 不能够从 这个表中查询数据。
重新create table table_rep as select * from hbase_test
tmp> select json_extract(json_array_get(frend,0), '$.phone') from table_rep;
-
hive建立内部表映射hbase_hive中创建hbase映射表
2020-12-19 11:18:11use cmpay_credit;-- Create external table for USER in HBasedrop table if exists ex_user;create external table if not exists ex_user(rowid string,account_level string,na...use cmpay_credit;
-- Create external table for USER in HBase
drop table if exists ex_user;
create external table if not exists ex_user(
rowid string,
account_level string,
name string,
boss_brand string,
credit_level string,
birthday string,
cmpay_id string,
fst_consume_day string,
bind_card_type string,
score_identity string,
is_validate string,
is_black_list string,
lastest_active_date string,
score_history_credit string,
register_date string,
score_time string,
user_id string,
admiss_date string,
score_behavior string,
score_social_cycle string,
sex string,
score_performance string,
is_real string,
mobile_no string,
bind_card_amount string,
cur_year_fst_login_day string,
score_total string
) ROW FORMAT SERDE 'org.apache.hadoop.hive.hbase.HBaseSerDe'
stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES(
"hbase.columns.mapping"=":key, cf:account_level, cf:name, cf:boss_brand,
cf:credit_level, cf:birthday, cf:cmpay_id, cf:fst_consume_day,
cf:bind_card_type, cf:score_identity, cf:is_validate, cf:is_black_lisT,
cf:lastest_active_date, cf:score_history_credit, cf:register_date,
cf:score_time, cf:user_id, cf:admiss_date, cf:score_behavior,
cf:score_social_cycle, cf:sex, cf:score_performance, cf:is_real, cf:mobile_no,
cf:bind_card_amount, cf:cur_year_fst_login_day, cf:score_total")
TBLPROPERTIES( "hbase.table.name"="USER");
-- export records of specified fields from ex_user
insert overwrite local directory '/tmp/user_score'
row format delimited fields terminated by ',' select mobile_no, score_behavior,
score_history_credit, score_identity, score_performance, score_social_cycle,
score_total from ex_user;
注意一点
rowid string,
对应key
-
hive:与hbase映射表
2019-11-06 10:06:30CREATE EXTERNAL TABLE `ood.ods_aim_ki_cords_real_time`( `id` bigint, `employeeno` string, `employeename` string, `branchno` string, `postno` string, `teamno` string, `clientid` in...CREATE EXTERNAL TABLE `ood.ods_aim_ki_cords_real_time`( `id` bigint, `employeeno` string, `employeename` string, `branchno` string, `postno` string, `teamno` string, `clientid` int, `origin` string, `clientname` string, `contracttype` string, `contractid` int, `status` string, `fillindate` string, `isapprove` boolean, `advice` string, `approveno` string, `approvename` string, `addtime` string, `updatetime` string, `role` string, `branchname` string, `teamname` string) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping" =":key,information:EmployeeNo, information:EmployeeName, information:BranchNo, information:PostNo, information:TeamNo, information:ClientId, information:Origin, information:ClientName, information:ContractType, information:ContractId, information:Status, information:FillinDate, information:IsApprove, information:Advice, information:ApproveNo, information:ApproveName, information:AddTime, information:UpdateTime, information:Role, information:BranchName, information:TeamName") TBLPROPERTIES("hbase.table.name" = "ai_ki_cords","hbase.mapred.output.outputtable"="ai_ki_cords");
注意:hbase中应当已经存在ai_ki_cords这张表了!
-
Hive与HBase映射表 实现大数据的增量操作
2018-02-07 16:03:25我之前mysql同步hadoop 创建了hive事务表 但是效果很差 这里另辟蹊径,将数据存入hbase 很快 建立映射 这样解决了效率问题。 概念 详解: HIve有 内部表 和外部表 针对于HBase来说 外部表 –》HBase已经存在这...先说下使用场景 :
HIve有Orc表 可以增删改 但是每一个事务执行的速度很慢 不适合于高并发的场景。
我之前mysql同步hadoop 创建了hive事务表 但是效果很差 这里另辟蹊径,将数据存入hbase 很快 建立映射 这样解决了效率问题。概念 详解:
HIve有 内部表 和外部表 针对于HBase来说外部表 –》HBase已经存在这张表 hive只建立映射 在hive中删除这张表 HBase不收任何影响 在Hive中创建HBase映射的外部表 前提条件 HBase存在这张表
内部表–》HBase不存在这张表 在HIve中建立HBase映射的内部表 首先HBase不能存在这张表 建立好Hive表会自动在HBase中创建同样结构的表 在Hive中删掉这张表 HBase也会自动删除
不论内部 外部 disable 表 hive查询会报错
/*##这是创建hive表的基本格式## */ /*这里是外部表 内部表格式不变 去掉external就行*/ create external table student (id int, name string, age int, sex string, address string, math int) /* #设置hive的存储格式 是hbase##*/ stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' /*这里按照上面hive顺序 与HBase一一对应 :key表示rowKey info:age代表列族:列*/ with serdeproperties ("hbase.columns.mapping"=" :key, info:name, info:age, info:sex, info:address, score:math, score:english") /*这里是表的对应关系 对应我 命名空间:表名 当然你可以用默认的命名空间*/ TBLPROPERTIES ("hbase.table.name" = "school:student");
-
Ambari中使用Spark连结Hive读取Hbase映射表
2019-01-22 15:45:002019独角兽企业重金招聘Python工程师标准>>> ... -
phoenix 查询hbase映射表 的数据格式转换问题
2017-12-01 11:12:53phoenix创建其映射表时,将INFO列族的AGE列设置为Integer类型 (由于初次使用,表结构比较乱,只看AGE列即可) 通过phoenix查询映射表,AGE值为正确格式,如下图所示: [img=... -
phoenix创建hbase的映射表
2018-08-23 11:53:47phoenix创建hbase的映射表 ... 注意:在phoenix创建hbase映射表时,如果hbase的表是小写,一定要在创建phoenix映射表时小写表名加上引号,phoenix映射表的字段不管hbase的字段是大小写都要加上引号,... -
Hbase映射hive表的方式
2019-12-02 21:23:22Hbase映射hive表 使用HSQL创建一个指向Hbase表的Hive表 两种创建表方式分别如下:区别,主要看数据在hbase下还是在hive下。 1.如果Hbase表已经存在,可以创建外部表,代码如下: Create external table hive_table_... -
hbase映射hive表的DDL
2018-07-31 16:19:20将hbase中的表PCB_SYS:W_SCHEDULE_KETTLE映射到hive中:smes_source.w_schedule_hbase: create external table smes_source.w_schedule_hbase ( rowkey string, schedule_id int, wo_code string, bom_97_... -
hbase 映射hive表
2016-09-05 09:31:39CREATE EXTERNAL TABLE `core_business_preview.operation_enterprise_active_daily`( `action_date` string, `enterprise_id` string, `enterprise_account` string, `industry` string, -
Spark SQL 读取hbase映射到hive的表
2020-02-29 01:53:04这篇文章主要来介绍一下用Spark SQL 如何读取hbase映射到hive的表,有的时候我们的数据存储在hbase中,但是想要用spark去分析,这时候就要用spark读取hbase的数据,spark读取hbase中的数据有很多种方式,今天来介绍一种... -
Phoenix与HBase映射问题
2021-01-03 13:08:43Phoenix与HBase映射问题 在使用phoenix与hbase表进行表映射时,由于phoenix列映射模式,字符集与hbase字符集不一致,导致映射建立不上。 现象是在phoenix中count表数据量与hbase能对应上,但是查不出具体数据;反... -
Phoenix与hbase的表映射
2020-04-27 11:02:15文章目录phoenix映射HBase视图映射表映射总结: phoenix映射HBase 默认情况下,直接在hbase中创建的表,通过phoenix是查看不到的。 如果要在phoenix中操作由hbase创建的表,则需要在phoenix中进行表的映射。 映射... -
和hbase映射_hbase集成hive
2021-01-14 03:24:04前言hive提供了与Hbase的集成,是的能够在Hbase表上使用hive sql语句进行查询、插入操作以及进行join和Union等复杂查询、同时也可以将hive表中的数据映射到Hbase中。 当我们在使用hive时候,在数据量多的时候就会... -
Hbase 映射 Hive
2019-03-20 15:49:21没被external关键字修饰,数据由Hive自身管理,hive drop掉此表时,hbase也被drop create TABLE hiveTableName( key string, name string ) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'... -
Spark SQL读取hbase映射到hive表--开发流程介绍
2018-07-25 11:53:00如何在本地使用SparkSQL连接hbase映射到hive的外部表,操作步骤如下: 一、在pom文件中添加所需的依赖,如下是必要的依赖,根据自己的实际情况选择对应版本,如果运行时找不到某些类,可能还需添加其它依赖。 &... -
删除Phoenix映射表的同时不删除hbase原表
2019-09-10 16:37:58说明:下面的过程是我推测的过程,具体结果不一定能删除成功(我走过...有需要的可以看看可不可以(我预计删除完映射表以后可能需要重启Phoenix,以及hbase吧(我的项目有重启过))) 操作流程: --1删除Phoenix上的映射表,... -
hbase映射为hive表(转载+整理+自己验证)
2020-05-30 16:33:13本文是对[1][2]的整理以及在新版本上的验证 -----------------------------------------------------------------------------... Hbase 2.2.4 Hive 3.0.0 ---------------------------------------------. -
测试Hbase 表映射成 Hive表查询效率
2019-09-14 17:17:02一、准备工作: 1、编写程序将1000万条数据写到Hbase表中;... 2、将对应的Hbase表映射成Hive表。 在Hive 的shell中执行类似如下的命令 hive> CREATE EXTERNAL TABLE IF NOT EXISTS t_hbase_per... -
Hive映射Hbase关联表
2018-07-18 14:03:22Hive映射Hbase表 CREATE EXTERNAL TABLE DAC_test01( rowkey STRING, name STRING, address STRING) ROW FORMAT SERDE 'org.apache.hadoop.hive.hbase.HBaseSerDe' STORED BY 'org.apache.hadoop.hive.hbase.... -
Phoenix--建立与HBase表映射
2020-12-21 17:44:15建立与HBase表映射1、在HBase中,建立employee的映射表---数据准备2、建立映射视图3、查询所有映射表数据4、查询职位为 'worker' 的所有员工数据 在HBase已经存在表,需要使用 Phoenix 建立与 HBase的映射,从而以... -
Phoenix映射HBase数据表
2017-05-11 18:25:01安装好phoenix后对于Hbase中已经存在的数据表不会自动进行映射,所以想要再phoenix中操作HBase已有数据表就需要手动进行配置。 2. 创建HBase表 hbase(main):002:0> create 'phoenix','info' 3. 插入数据 hbase... -
phoenix映射HBase数据表
2017-09-11 17:48:33安装好phoenix后对于Hbase中已经存在的数据表不会自动进行映射,所以想要再phoenix中操作hbase已有数据表就需要手动进行配置。 2. 创建HBase表 > create 'phoenix','info' 3. 插入数据 > put '... -
将hbase的表映射到hive中
2018-09-28 11:06:54@将hbase的表映射到hive中 –key是hbase的rowkey, 各个字段是hbase中的quailiter CREATE external TABLE hbase_table_1(key String, name string) – 创建hive的表 STORED BY ‘org.apache.hadoop.hive.hbase.... -
Hive中建立HBase的映射表
2020-03-23 19:10:40CREATE EXTERNAL TABLE userPhoto( uid string , tag string , tagweight double ) ...'org.apache.hadoop.hive.hbase.HBaseSerDe' STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' W... -
hive映射hbase表数据
2020-09-09 20:01:53一般来说,hive映射表数据都是映射hdfs上的数据,直接通过location 指定映射目录,然后可以查询数据。但是hive映射hbase表数据,是直接映射hbase中的表。 hbase需要被hive映射的表的建表语句 create 'events_db:user... -
hbase的表映射到hive中
2018-07-14 18:53:081.本文主要说一下怎么把hbase中的表映射到hive中,说之前我们先简单说一下hive的内部表和外部表的区别; (1),被external关键字修饰的表是外部表,没有被external关键字修饰的表是内部表. (2),内部表数据由Hive自身...
-
2021-01-26
-
SpringBoot项目中的目录结构,以及每个目录的作用是什么。
-
android笔试面试和实战课程
-
thinkphp5.1博客后台实战视频
-
hive sql常用开窗函数
-
30个生涯锦囊,带你跳出迷茫,找到适合你的职业方向
-
基于深度跳跃级联的图像超分辨率重建
-
2.8 μm增益开关Er∶ZBLAN光纤激光器的数值模拟
-
李宏毅机器学习Lesson2——Logistic Regression实现收入预测
-
PDM
-
窗口消息钩子函数hook,此程序用于侦听截获窗口消息.zip
-
【数据分析实战训练营】Hive详解
-
SQL Server 2016 高可用灾备技术合集
-
2021美赛备赛资料大全
-
Honeywell_PowerTools_CE_61_6500.rar
-
数字闭环全光纤电流互感器的信号处理
-
电商设计专业思维
-
21年新消息队列RabbitMQ视频教程AMQP教程
-
关于深搜
-
星载太阳辐照度光谱仪短时高精度太阳预报