# Hive query from elasticsearch

**URL:** https://discuss.elastic.co/t/hive-query-from-elasticsearch/22054
**Category:** Elasticsearch
**Created:** [February 10, 2015, 5:59am UTC](https://discuss.elastic.co/t/hive-query-from-elasticsearch/22054 "2015-02-10T05:59:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![zouxcs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zouxcs/32/920_2.png) [@zouxcs](https://discuss.elastic.co/u/zouxcs)
#### Post date: [February 10, 2015, 5:59am UTC](https://discuss.elastic.co/t/hive-query-from-elasticsearch/22054/1 "2015-02-10T05:59:35Z")

</div>

Hi,guys,I want to use hive sql to query real-time ES data.As the doc  
says,first I must create a external table while I transfer sql to  
rest-query? And then I use sql to query data from the external table?  
Can I directly use sql to query ES? I am confused with that process.  
Thank you!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bb13bc3d-7c55-4fc4-9392-eb2c85079669%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bb13bc3d-7c55-4fc4-9392-eb2c85079669%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)
#### Post date: [February 10, 2015, 10:00am UTC](https://discuss.elastic.co/t/hive-query-from-elasticsearch/22054/2 "2015-02-10T10:00:56Z")

</div>

You cannot use Hive SQL without Hive. In other words, with es-hadoop, you cannot just use arbitrary SQL on top of Elastic.  
What you can however interact with Elasticsearch from within a Hive environment, meaning you can execute Hive SQL on top  
of Hive  
which underneath communicates with Elastic.  
This is explained in the docs in the Hive chapter [1]

[1] [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/hadoop/master/hive.html)

On 2/10/15 7:59 AM, XIAoCHeN ZOu wrote:

> Hi,guys,I want to use hive sql to query real-time ES data.As the doc says,first I must create a external table while I  
> transfer sql to rest-query? And then I use sql to query data from the external table?  
> Can I directly use sql to query ES? I am confused with that process.  
> Thank you!
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/bb13bc3d-7c55-4fc4-9392-eb2c85079669%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bb13bc3d-7c55-4fc4-9392-eb2c85079669%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/bb13bc3d-7c55-4fc4-9392-eb2c85079669%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bb13bc3d-7c55-4fc4-9392-eb2c85079669%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Costin

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/54D9D6D8.90007%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/54D9D6D8.90007%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [July 6, 2017, 12:33am UTC](https://discuss.elastic.co/t/hive-query-from-elasticsearch/22054/3 "2017-07-06T00:33:58Z")

</div>


