Reputation: 21
When I create external table in hive stored by ElasticSearch Handler, it works without error:
*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');*
When I insert data in it , it works
But when I try to query it, I get error:
Failed with exception java.io.IOException:org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Index [test/test] missing and settings [es.index.read.missing.as.empty] is set to false
When I check indices list, 'test' does not appear
curl 'localhost:9200/_cat/indices?v'
Please Help
Upvotes: 1
Views: 673
Reputation: 11
'es.index.auto.create' default to true
just add this
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'**);
i think it may solve the problem
Upvotes: 1