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外部表的更多相关文章

  1. hadoop笔记之Hive的数据存储(外部表)

    Hive的数据存储(外部表) Hive的数据存储(外部表) 外部表 指向已经在HDFS中存在的数据,可以创建Partition 它和内部表在元数据的组织上是相同的,而实际数据的存储则有较大的差异 外部 ...

  2. 二十、Hadoop学记笔记————Hive On Hbase

    Hive架构图: 一般用户接口采用命令行操作, hive与hbase整合之后架构图: 使用场景 场景一:通过insert语句,将文件或者table中的内容加入到hive中,由于hive和hbase已经 ...

  3. hive中与hbase外部表join时内存溢出(hive处理mapjoin的优化器机制)

    与hbase外部表(wizad_mdm_main)进行join出现问题: CREATE TABLE wizad_mdm_dev_lmj_edition_result as select *  from ...

  4. Hive创建内部表、外部表

    使用hive需要hive环境 启动Hive 进入HIVE_HOME/bin,启动hive ./hive 内部表 建表 hive> create table fz > (id int,nam ...

  5. Hive 建外链表到 Hbase(分内部表、外部表两种方式)

    一. Hive 建内部表,链到hbase :特点:Hive drop表后,Hbase 表同步删除 drop table if exists hbase_kimbo_test1;CREATE TABLE ...

  6. 创建hive与hbase关联的hive表与hbase表

    创建hive与hbase的关联表 create external table hive_hbase(rowkey string,name string,addr string,topic string ...

  7. hive on hbase 数据表关联

    有时,数据可以容易的存储在hive中,但是要导入到hbase里,可以不用写MR程序来操作,可以使用hive on hbase方式来创建相应的表关联关系来将hive中的数据导入到对应的hbase的表里, ...

  8. hive内部表&外部表介绍

    未被external修饰的是内部表(managed table),被external修饰的为外部表(external table):区别:内部表数据由Hive自身管理,外部表数据由HDFS管理:内部表 ...

  9. hive学习笔记之三:内部表和外部表

    欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...

随机推荐

  1. python后端开发面试总结

    网络协议 通信计算机双方必须共同遵从的一组约定,只有遵守这个约定,计算机之间才能相互通信交流 TCP / IP TCP/IP(传输控制协议/网际协议)是指能够在多个不同网络间实现信息传输的协议簇.TC ...

  2. try catch finally语句块中存在return语句时的执行情况剖析

    2种场景 (1) try中有return,finally中没有return(注意会改变返回值的情形);(2) try中有return,finally中有return; 场景代码分析(idea亲测) 场 ...

  3. mysql 应用 持续更新

    1.安装方法 贴出,my.ini # MySQL Server Instance Configuration File # -------------------------------------- ...

  4. 【C++】《C++ Primer 》第六章

    第六章 函数 一.函数基础 函数定义:包括返回类型.函数名字和0个或者多个形参(parameter)组成的列表和函数体. 调用运算符:调用运算符的形式是一对圆括号 (),作用于一个表达式,该表达式是函 ...

  5. 在阿里云托管的k8s上使用nas做动态存储

    前言 关于aliyun托管k8s的存储插件主要有两种: CSI # kubectl get pod -n kube-system | grep csi-plugin csi-plugin-8bbnw ...

  6. 按装parallels tool的失败之路

    这是一篇对于其他人来说没什么意义的博客.单纯的可以被看作是日记. 首先,我想安装parallels tool. 但是照着网上很多教程(如www.cnblogs.com/artwalker/p/1323 ...

  7. (二)数据源处理2-xlrd操作excel

    import xlrd3workbook = xlrd3.open_workbook('test_data.xlsx')sheet =workbook.sheet_by_name('Sheet1')p ...

  8. 【MySQL】CentOS7中使用systemctl工具管理启动和停止MySQL

    centos7以前版本,可以使用这个/etc/init.d/mysqld start 来启动mysql 但是centos7之后,通过systemctl start mysqld.service 这个要 ...

  9. poj-Decoding Morse Sequences(动态规划)

    Description Before the digital age, the most common "binary" code for radio communication ...

  10. 以我的亲身经历,聊聊学python的流程,同时推荐学python的书

    因为干活要用到,所以我大概于19年5月开始学python,大概学了1个月后,我就能干公司的活了,而且这python项目还包含了机器学习等要素,大概3个月后,我还承担了项目里开发机器学习数据分析的任务. ...