# Hive SQL term query

**URL:** https://discuss.elastic.co/t/hive-sql-term-query/39951
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [January 23, 2016, 4:34pm UTC](https://discuss.elastic.co/t/hive-sql-term-query/39951 "2016-01-23T16:34:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![andrewwwooster](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@andrewwwooster](https://discuss.elastic.co/u/andrewwwooster)
#### Post date: [January 23, 2016, 4:34pm UTC](https://discuss.elastic.co/t/hive-sql-term-query/39951/1 "2016-01-23T16:34:13Z")

</div>

I'm love being able to use Hive SQL to effectively filter Elasticsearch. 😃

However, I am not sure how to best access the elasticsearch term query from SQL. I've noted the 'es.query' = '?q=term' table property, which must be specified at table creation time. Is there a way to do a term query from SQL? Does the SQL LIKE operation leverage the term index?

---

<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: [January 24, 2016, 7:31pm UTC](https://discuss.elastic.co/t/hive-sql-term-query/39951/2 "2016-01-24T19:31:13Z")

</div>

Hive SQL is not pushed down to ES since there are no hooks one can use. That is, ES-Hadoop is unaware of what the user wants outside the number of fields requires for a table (and thus can perform projection).  
Spark SQL on the other hand does that so ES-Hadoop can and will transform the queries/operations into query DSL automatically.

If you want/have to use Hive then you need to pass the queries yourself. This is not too much of a problem considering many times the data is known before hand and one can incorporate the queries into resources/files which can then be passed along (as oppose to writing them inline).

---

<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, 1:26pm UTC](https://discuss.elastic.co/t/hive-sql-term-query/39951/3 "2017-07-06T13:26:22Z")

</div>


