# Question about Reading Flattened Field from ES Index to Pyspark

**URL:** <https://discuss.elastic.co/t/question-about-reading-flattened-field-from-es-index-to-pyspark/297189>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [February 14, 2022, 8:01pm UTC](https://discuss.elastic.co/t/question-about-reading-flattened-field-from-es-index-to-pyspark/297189 "2022-02-14T20:01:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![musku](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/musku/32/101814_2.png) [@musku](https://discuss.elastic.co/u/musku)\
**Post date:** [February 14, 2022, 8:01pm UTC](https://discuss.elastic.co/t/question-about-reading-flattened-field-from-es-index-to-pyspark/297189/1 "2022-02-14T20:01:20Z")

</div>

Hi ,  
I am trying to read flattened Filed from Elasticsearch .  
I will be able to read all filed from Index except Flattened Datatype filed.  
Could you please let me know how to read that filed from Spark.  
Any option that i have to enable from spark to read flattened fields?

---

<div class="post-metadata">

**Author:** ![Keith\_Massey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/keith_massey/32/83666_2.png) [@Keith\_Massey](https://discuss.elastic.co/u/Keith_Massey)\
**Post date:** [February 15, 2022, 2:16pm UTC](https://discuss.elastic.co/t/question-about-reading-flattened-field-from-es-index-to-pyspark/297189/2 "2022-02-15T14:16:39Z")

</div>

Hi @musku. Unfortunately we don't yet support all Elasticsearch field types in es-spark. Flattened fields are on my to-do list -- [Support for all Elasticsearch field types · Issue #1813 · elastic/elasticsearch-hadoop · GitHub](https://github.com/elastic/elasticsearch-hadoop/issues/1813). I don't know of a workaround at the moment but I'll try to take a look at some point soon.

---

<div class="post-metadata">

**Author:** ![Keith\_Massey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/keith_massey/32/83666_2.png) [@Keith\_Massey](https://discuss.elastic.co/u/Keith_Massey)\
**Post date:** [February 15, 2022, 11:37pm UTC](https://discuss.elastic.co/t/question-about-reading-flattened-field-from-es-index-to-pyspark/297189/3 "2022-02-15T23:37:14Z")

</div>

I just took a look, and unfortunately I don't see an obvious workaround or even a really simple code change to get flattened fields to work.

---

<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:** [March 15, 2022, 11:38pm UTC](https://discuss.elastic.co/t/question-about-reading-flattened-field-from-es-index-to-pyspark/297189/4 "2022-03-15T23:38:01Z")

</div>

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