# Query elasticsearch from hive with es-hadoop 5.1.1

**URL:** https://discuss.elastic.co/t/query-elasticsearch-from-hive-with-es-hadoop-5-1-1/69558
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [December 20, 2016, 10:47am UTC](https://discuss.elastic.co/t/query-elasticsearch-from-hive-with-es-hadoop-5-1-1/69558 "2016-12-20T10:47:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Tommaso\_Anzidei](https://avatars.discourse-cdn.com/v4/letter/t/8797f3/32.png) [@Tommaso\_Anzidei](https://discuss.elastic.co/u/Tommaso_Anzidei)
#### Post date: [December 20, 2016, 10:47am UTC](https://discuss.elastic.co/t/query-elasticsearch-from-hive-with-es-hadoop-5-1-1/69558/1 "2016-12-20T10:47:11Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![james.baiera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james.baiera/32/10209_2.png) [@james.baiera](https://discuss.elastic.co/u/james.baiera)
#### Post date: [January 13, 2017, 8:06pm UTC](https://discuss.elastic.co/t/query-elasticsearch-from-hive-with-es-hadoop-5-1-1/69558/2 "2017-01-13T20:06:35Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 10, 2017, 8:06pm UTC](https://discuss.elastic.co/t/query-elasticsearch-from-hive-with-es-hadoop-5-1-1/69558/3 "2017-02-10T20:06:40Z")

</div>

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