目的
将hive表中的数据写入到es(6.0.0)以供查询。
流程
- 将对应版本jar 包 jarelasticsearch-hadoop-6.0.0.jar放在hdfs目录下。
- 创建hive表, 构造hive table 与es 索引的映射
CREATE EXTERNAL TABLE `bi.es_hive_extra_test`( `id` string COMMENT 'from deserializer', `name` string COMMENT 'from deserializer', `age` bigint COMMENT 'from deserializer' ) STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler' TBLPROPERTIES ( 'COLUMN_STATS_ACCURATE'='false', 'es.index.auto.create'='true', 'es.mapping.id'='id', 'es.nodes'='10.110.110.110', 'es.nodes.wan.only'='false', 'es.port'='9200', 'es.resource'='es_hive_extr