# Support for Aggregations in Spark

**URL:** https://discuss.elastic.co/t/support-for-aggregations-in-spark/182251
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [May 22, 2019, 2:36pm UTC](https://discuss.elastic.co/t/support-for-aggregations-in-spark/182251 "2019-05-22T14:36:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![angelazhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/angelazhao/32/46636_2.png) [@angelazhao](https://discuss.elastic.co/u/angelazhao)
#### Post date: [May 22, 2019, 2:36pm UTC](https://discuss.elastic.co/t/support-for-aggregations-in-spark/182251/1 "2019-05-22T14:36:21Z")

</div>

Is it now possible to perform ES aggregations using Spark?

An earlier post from March 2016 says the functionality isn't available yet but is on the roadmap.

> [@ES Aggregations in Spark](https://discuss.elastic.co/t/es-aggregations-in-spark/45588):
>
> Hello everyone, based on discussion about [ES use cases](https://discuss.elastic.co/t/use-cases-elasticsearch-and-spark/29746) I was wondering whether there is any way how Spark could benefit from ES aggregations and convert them to Dataframe. F.e something like: val esConf = ... val esQuery = """{"agg" : {"my\_agg" : {"terms" : {"field": "field\_A"} } } }""" val jsonResult = client.search(esQuery, esConf) val transformer = ... val df = jsonResult.toDF(transformer) val result = df.filter(...).join(otherDf) .... A) Is there any plan to support something similar in E…

Can you please give me an update on its status?

Thanks!

---

<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: [June 19, 2019, 2:36pm UTC](https://discuss.elastic.co/t/support-for-aggregations-in-spark/182251/2 "2019-06-19T14:36:28Z")

</div>

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

---

<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: [June 24, 2019, 3:14am UTC](https://discuss.elastic.co/t/support-for-aggregations-in-spark/182251/3 "2019-06-24T03:14:35Z")

</div>

@angelazhao This issue is a big one that the project is looking to complete, but at the moment work on it is stalled. You can follow the issue [here](https://github.com/elastic/elasticsearch-hadoop/issues/276#issuecomment-437949973)
