Query elasticsearch from hive with es-hadoop 5.1.1

Hi,
we are upgrading elk from 2.2.0 to 5.1.1
From our hadoop system we added in hive jars the es-hadoop 5.1.1.jar
and then as usual we write something like

CREATE EXTERNAL TABLE mylogs
(
etc...
)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES
(
'es.resource' = 'myindex/mytype',
etc...
);

Now if we try a statement like "select * from mylogs limit 10" we receive the error:

java.io.IOException: org.elasticsearch.hadoop.rest.EsHadoopInvalidRequest: No search type for [scan] {"query":{"match_all":{}}}

and it makes sense because search type scan was removed from 5.x

But how can we now query elasticsearch from hive?

Thanks!

Please make sure that all hive executor nodes have the new library installed, and that you are targeting a compatible version of elasticsearch.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.