# Unable to read flattened type field using pyspark connector

**URL:** <https://discuss.elastic.co/t/unable-to-read-flattened-type-field-using-pyspark-connector/217349>\
**Category:** Elasticsearch\
**Created:** [January 31, 2020, 10:22am UTC](https://discuss.elastic.co/t/unable-to-read-flattened-type-field-using-pyspark-connector/217349 "2020-01-31T10:22:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amendhe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amendhe/32/61834_2.png) [@amendhe](https://discuss.elastic.co/u/amendhe)\
**Post date:** [January 31, 2020, 10:22am UTC](https://discuss.elastic.co/t/unable-to-read-flattened-type-field-using-pyspark-connector/217349/1 "2020-01-31T10:22:05Z")

</div>

After reading index from elasticsearch using pyspark in databricks - All fields appeared but only one field which is a type of 'flattened' type not appeared in dataframe schema. Is there any option that i need to include during reading. Following is my snippet to read from the index.

```auto
spark.read.format("org.elasticsearch.spark.sql")\
      .option("es.nodes", ",".join(db['nodes']))\
      .option("es.mapping.date.rich", "false")\
      .option("es.net.http.auth.user", 'abc')\
      .option("es.net.http.auth.pass", '123abc')\
      .load('indexname')

```

elasticsearch: 7.5.1  
spark: 2.4.3

---

<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:** [February 28, 2020, 10:22am UTC](https://discuss.elastic.co/t/unable-to-read-flattened-type-field-using-pyspark-connector/217349/2 "2020-02-28T10:22:10Z")

</div>

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