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 ...
随机推荐
- LAMP架构之PHP-FPM 服务器 转
安装PHP 解决依赖关系 # 请配置好yum源(系统安装源及epel源)后执行如下命令: yum -y groupinstall "Desktop Platform Development& ...
- Map遍历的几种方式
代码示例 /** * @author liaowenhui * @date 2020/6/25 11:15 */ public class TestMap { public static void m ...
- CSS_rules
CSS 特性 1)控制灵活,功能强大 元素-->标签 针对html的元素 2)可以设置html元素的属性,与html框架的进行分离 3)执行效率更高 CSS语法 text-indent 文字缩进 ...
- Linux下安装Oracle11g服务器【转】
安装环境 Linux服务器:oracle linux 6.6 64位 Oracle服务器:Oracle11gR2 64位 系统要求 Linux安装Oracle系统要求 系统要求 说明 内存 必须高于1 ...
- 容器编排系统K8s之crd资源
前文我们了解了k8s节点污点和pod的对节点污点容忍度相关话题,回顾请参考:https://www.cnblogs.com/qiuhom-1874/p/14255486.html:今天我们来聊一下扩展 ...
- [从源码学设计]蚂蚁金服SOFARegistry之续约和驱逐
[从源码学设计]蚂蚁金服SOFARegistry之续约和驱逐 目录 [从源码学设计]蚂蚁金服SOFARegistry之续约和驱逐 0x00 摘要 0x01 业务范畴 1.1 失效剔除 1.2 服务续约 ...
- Java开发手册之编程规约
时隔一年多,再次开始更新博客,各位粉丝们久等了.大家是不是以为我像大多数开发者一样三分钟热度,坚持了一年半载就放弃了,其实不是.在过去的一年时间我学习了<Java编程思想>这本书,因为都是 ...
- MySQL select if 查询最后一个主键 id
查询最后一个主键id SELECT IF(MAX(id) IS NULL, 0, MAX(id)) AS maxid FROM users; 查询最小的主键id SELECT IF(MIN(id) I ...
- 【Linux】snmp在message中报错: /etc/snmp/snmpd.conf: line 311: Error: ERROR: This output format has been de
Apr 17 17:36:17 localhost snmpd[2810]: /etc/snmp/snmpd.conf: line 311: Error: ERROR: This output for ...
- ORA-00245 control file backup operation failed 分析和解决
一.问题说明 操作系统: RedHat 5.8 数据库: 11.2.0.3 2节点RAC. 使用RMAN 备份的时候,报如下错误: ORA-00245: control file backup fai ...