Hive创建HBase,ES外部表
1、创建HBase外部表
CREATE EXTERNAL TABLE `ods_women`(
`rowkey` string COMMENT 'from deserializer',
`article` string COMMENT 'from deserializer',
`url` string COMMENT 'from deserializer',
`web` string COMMENT 'from deserializer',
`keyword` string COMMENT 'from deserializer',
`acquire_time` string COMMENT 'from deserializer',
`article_time` string COMMENT 'from deserializer',
`calculate_time` string COMMENT 'from deserializer',
`title` string COMMENT 'from deserializer',
`english_industry` string COMMENT 'from deserializer')
STORED BY
'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES (
'hbase.columns.mapping'=':key,info:article_word,info:article_url,info:website,info:chinese_keyword,info:acquire_time,info:article_time,info:calculate_time,info:article_title,info:english_industry')
TBLPROPERTIES ( 'hbase.table.name'='test:ods_women');
2、创建es外部表
1)下载相关jar包
https://www.elastic.co/cn/downloads/past-releases#es-hadoop
2)hive命令行输入
add jar /home/jar/elasticsearch-hadoop-5.5.3/dist/elasticsearch-hadoop-5.5.3.jar;
3)创建表
drop table if exists dw_women_article_core;
create external table dw_women_article_core(
md5id string,
article_id string,
keyword string,
search_keyword string,
keyword_weight bigint,
article_title string,
article_content string,
web string,
article_date string,
status bigint,
keyword_push string
)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES('es.nodes' = '192.168.2.14:9200',
'es.index.auto.create' = 'true',
'es.resource' = 'app_knowledgegraph_new/app_women_article_core',
'es.mapping.id' = 'md5id',
'es.mapping.names' = 'md5id:md5id,article_id:article_id,keyword:keyword,search_keyword:search_keyword,keyword_weight:keyword_weight,article_title:article_title,web:web,article_date:article_date,status:status,keyword_push:keyword_push,article_content:article_content',
'es.nodes.wan.only' = 'true');
es.index.auto.create (default yes)
Whether elasticsearch-hadoop should create an index (if its missing) when writing data to Elasticsearch or fail.
es.nodes.wan.only (default false)
Whether the connector is used against an Elasticsearch instance in a cloud/restricted environment over the WAN, such as Amazon Web Services. In this mode, the connector disables discovery and only connects through the declared es.nodes during all operations, including reads and writes. Note that in this mode, performance is highly affected.
Hive创建HBase,ES外部表的更多相关文章
- hadoop笔记之Hive的数据存储(外部表)
Hive的数据存储(外部表) Hive的数据存储(外部表) 外部表 指向已经在HDFS中存在的数据,可以创建Partition 它和内部表在元数据的组织上是相同的,而实际数据的存储则有较大的差异 外部 ...
- 二十、Hadoop学记笔记————Hive On Hbase
Hive架构图: 一般用户接口采用命令行操作, hive与hbase整合之后架构图: 使用场景 场景一:通过insert语句,将文件或者table中的内容加入到hive中,由于hive和hbase已经 ...
- hive中与hbase外部表join时内存溢出(hive处理mapjoin的优化器机制)
与hbase外部表(wizad_mdm_main)进行join出现问题: CREATE TABLE wizad_mdm_dev_lmj_edition_result as select * from ...
- Hive创建内部表、外部表
使用hive需要hive环境 启动Hive 进入HIVE_HOME/bin,启动hive ./hive 内部表 建表 hive> create table fz > (id int,nam ...
- Hive 建外链表到 Hbase(分内部表、外部表两种方式)
一. Hive 建内部表,链到hbase :特点:Hive drop表后,Hbase 表同步删除 drop table if exists hbase_kimbo_test1;CREATE TABLE ...
- 创建hive与hbase关联的hive表与hbase表
创建hive与hbase的关联表 create external table hive_hbase(rowkey string,name string,addr string,topic string ...
- hive on hbase 数据表关联
有时,数据可以容易的存储在hive中,但是要导入到hbase里,可以不用写MR程序来操作,可以使用hive on hbase方式来创建相应的表关联关系来将hive中的数据导入到对应的hbase的表里, ...
- hive内部表&外部表介绍
未被external修饰的是内部表(managed table),被external修饰的为外部表(external table):区别:内部表数据由Hive自身管理,外部表数据由HDFS管理:内部表 ...
- hive学习笔记之三:内部表和外部表
欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...
随机推荐
- IP包头分析
• IP包头是IP协议(网络层,第三层)为数据包添加的头部. ○ 格式: ○ ○ 拆开看,每行是4+4+8+16=32bit=4Byte ○ ip协议最短20 ...
- FastApi 进阶
前言 终于有了第一个使用 FastApi 编写的线上服务, 在开发的过程中还是遇到了些问题, 这里记录一下 正文 目录结构 我们知道, FastApi 的启动方式推荐使用 uvicorn, 其启动方式 ...
- Openstack Nova 添加计算节点(六.一)
Openstack Nova 添加计算节点(六.一) # 重要的两点: 1 时间同步 2 yum 源 # 安装软件: yum install openstack-selinux openstack-n ...
- 行业动态 | 利用Cassandra数据库揭开家族祖先的秘密
FamilySearch选择了基于Apache Cassandra的DataStax Enterprise (DSE)来加速用户增长,并通过更快的反应时间.高可用性以及零数据库宕机来提供强大的 ...
- Python基础语法6-冒泡排序
用for循环实现冒泡排序(升序): array = [3,2,1] for i in range(len(array) - 1, 0, -1): for j in range(0, i): if ...
- 同一个网段内所有服务器virtual_router_id设置相同的后果
/var/log/messages中一直报的错 one or more VIP associated with VRID mismatch actual MASTER advert bogus VRR ...
- 以事实驳斥:改进你的c#代码的5个技巧(四)
测试使用的环境:vs2019+.net core3.1 原文地址:https://www.cnblogs.com/hhhnicvscs/p/14296715.html 反驳第一条:如何检查代码中的空字 ...
- 安装newman error:package exports for 'c:\nmp\node_modules\newman\node_module 解决办法
一.场景描述: 通过npm安装newman时,一直失败. 尝试了很多安装命令: npm install -g newman npm install -g newman --registry=http: ...
- PW6513高压40V的LDO芯片,SOT89封装
一般说明 PW6513系列是一款高精度,高输入电压,低静态电流,高速,低具有高纹波抑制的线性稳压器.输入电压高达40V,负载电流为在电压=5V和VIN=7V时高达300mA.该设备采用BCD工艺制造. ...
- 推荐几个学习Python的免费网站
想要学好Python,只靠看Python相关的书籍是远远不够的!今天为大家分享几个实用的Python学习网站. 欢迎各位热爱Python的小伙伴进群交流:610380249群里有大佬哦,而且很热心,群 ...