# Hive queries to read ES data taking too long | Need suggestions to improve

**URL:** <https://discuss.elastic.co/t/hive-queries-to-read-es-data-taking-too-long-need-suggestions-to-improve/46662>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [April 7, 2016, 10:37am UTC](https://discuss.elastic.co/t/hive-queries-to-read-es-data-taking-too-long-need-suggestions-to-improve/46662 "2016-04-07T10:37:33Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Preeti\_Raj\_Buchhada](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/preeti_raj_buchhada/32/8971_2.png) [@Preeti\_Raj\_Buchhada](https://discuss.elastic.co/u/Preeti_Raj_Buchhada)\
**Post date:** [April 13, 2016, 11:39am UTC](https://discuss.elastic.co/t/hive-queries-to-read-es-data-taking-too-long-need-suggestions-to-improve/46662/4 "2016-04-13T11:39:49Z")

</div>

Thanks for your reply Costin, I am now trying Spark SQL and the pushdown is working great!

I've created 2 more queries:

> [@Spark SQL : How to specify a date range in WHERE clause?](https://discuss.elastic.co/t/spark-sql-how-to-specify-a-date-range-in-where-clause/47240/1):
>
> Hello, I've got some success working with Spark SQL CLI to access our ES data. Environment: ES: 1.3.2 es-hadoop: elasticsearch-hadoop-2.2.0 Spark: spark-1.4.1-bin-hadoop2.6 The pushdown feature is working great! However, I'm stuck with how to specify a date range in the WHERE clause, so that it gets pushed down to ES? I've tried: SELECT count(member\_id),member\_id FROM data WHERE ( response\_timestamp \> CAST('2015-03-01' AS date) AND response\_timestamp \< CAST('2015-03-31' AS date) ) GRO…

> [@Spark SQL: count(\*) fetches all data](https://discuss.elastic.co/t/spark-sql-count-fetches-all-data/47242/1):
>
> Hello, I've got some success working with Spark SQL CLI to access our ES data. Environment: ES: 1.3.2 es-hadoop: elasticsearch-hadoop-2.2.0 Spark: spark-1.4.1-bin-hadoop2.6 The pushdown feature is working great! However, I noticed that for queries like: SELECT count(member\_id),member\_id FROM data WHERE ( member\_id \> 2049510 AND member\_id \< 2049520 ) GROUP BY member\_id ; es-hadoop ends up reading all data from ES. And hence these queries are taking way too long. In my case it took 44 …

---

_[View the full topic](https://discuss.elastic.co/t/hive-queries-to-read-es-data-taking-too-long-need-suggestions-to-improve/46662)._
