【问题标题】:hive elasticsearch external table creationhive elasticsearch外部表创建
【发布时间】:2017-02-22 18:07:54
【问题描述】:

当我在 ElasticSearch Handler 存储的配置单元中创建外部表时,它可以正常工作:

*CREATE  TABLE test (day STRING, idCust STRING)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES('es.resource' = 'test/test',
'es.mapping.names' = 'day:@timestamp',
'es.nodes' = 'localhost');*

当我在其中插入数据时,它可以工作

但是当我尝试查询它时,我得到了错误:

因异常 java.io.IOException:org.elasticsearch.hadoop.EsHadoopIllegalArgumentException 失败:索引 [test/test] 缺失且设置 [es.index.read.missing.as.empty] 设置为 false

当我检查索引列表时,'test' 没有出现

curl 'localhost:9200/_cat/indices?v'

请帮忙

【问题讨论】:

    标签: hadoop elasticsearch hive


    【解决方案1】:

    'es.index.auto.create' 默认为true

    添加这个

    CREATE  TABLE test (day STRING, idCust STRING)
    STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
    TBLPROPERTIES('es.resource' = 'test/test',
    'es.mapping.names' = 'day:@timestamp',
    'es.nodes' = 'localhost', **'es.index.auto.create' = 'true','es.index.read.missing.as.empty'='yes'**);
    

    我认为它可以解决问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-25
      • 1970-01-01
      • 2017-08-17
      • 1970-01-01
      相关资源
      最近更新 更多