将数据从配置单元提交到es时获取“eshadoopillegalargumentexception:index[petrol/petrolcat]missing and settings”

jpfvwuh4  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(607)

有人能帮我解决这个错误吗。由于此异常,我无法将配置单元数据加载到ElasticSearch。
--配置单元控制台代码

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>
        >
        >
gmxoilav

gmxoilav1#

添加“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');

相关问题