gpt4 book ai didi

hadoop - 从Hive加载数据到ES时获取 “EsHadoopIllegalArgumentException: Index [petrol/petrolCat] missing and settings”

转载 作者:行者123 更新时间:2023-12-02 20:48:39 26 4
gpt4 key购买 nike

有人可以帮我解决这个错误。由于此异常,我无法将配置单元数据加载到Elastic Search。

-Hive控制台代码

    Hive>
> create external table petrol_es(distributer_id STRING,distributer_name STRING,amt_IN STRING,amy_OUT STRING,vol_IN INT,vol_OUT INT,year INT)
> ROW FORMAT SERDE 'org.elasticsearch.hadoop.hive.EsSerDe'
> STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
> tblproperties('es.resource' = 'petrol/petrolCat');
OK
Time taken: 0.16 seconds
hive>
>
> select * from petrol_es;
OK
Failed with exception java.io.IOException:org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Index [petrol/petrolCat] missing and settings [es.field.read.empty.as.null] is set to false
Time taken: 0.156 seconds
hive>
>
>

最佳答案

添加'es.index.auto.create'='true','es.index.read.missing.as.empty'='yes'属性后,此问题得以解决。

--DDL

    create external table  petrol_es(distributer_id STRING,distributer_name STRING,amt_IN STRING,amy_OUT STRING,vol_IN INT,vol_OUT INT,year INT)
ROW FORMAT SERDE 'org.elasticsearch.hadoop.hive.EsSerDe'
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
tblproperties('es.resource' = 'petrol/petrolCat','es.index.auto.create' = 'true','es.index.read.missing.as.empty'='yes');

关于hadoop - 从Hive加载数据到ES时获取 “EsHadoopIllegalArgumentException: Index [petrol/petrolCat] missing and settings”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46866758/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com