# Es.read.field.as.array.include multiple values

**URL:** <https://discuss.elastic.co/t/es-read-field-as-array-include-multiple-values/231812>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [May 8, 2020, 11:33pm UTC](https://discuss.elastic.co/t/es-read-field-as-array-include-multiple-values/231812 "2020-05-08T23:33:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramesh\_Nuthalapati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramesh_nuthalapati/32/68000_2.png) [@Ramesh\_Nuthalapati](https://discuss.elastic.co/u/Ramesh_Nuthalapati)\
**Post date:** [May 8, 2020, 11:33pm UTC](https://discuss.elastic.co/t/es-read-field-as-array-include-multiple-values/231812/1 "2020-05-08T23:33:10Z")

</div>

I understand from documentation that when I get this error

```auto
SparkException: Job aborted due to stage failure: Task 0 in stage 20.0 failed 4 times, most recent failure: Lost task 0.3 in stage 20.0 (TID 75, 10.244.241.30, executor 4): org.elasticsearch.hadoop.rest.EsHadoopParsingException: org.elasticsearch.hadoop.EsHadoopIllegalStateException: Field 'metadata.a.b.c.d' not found; typically this occurs with arrays which are not mapped as single value

```

I should do

```auto
spark.read.xx.
.option("es.read.field.as.array.include", "metadata.a.b.c,metadata.a.b.c.d,metadata.a.b.c.d.e")

```

But it keep throwing the error even I include the option above.

Apache Spark 2.4.5,  
Scala 2.11  
ES hadoop 7.6.2

Any thoughts?

---

<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:** [May 14, 2020, 8:09pm UTC](https://discuss.elastic.co/t/es-read-field-as-array-include-multiple-values/231812/2 "2020-05-14T20:09:00Z")

</div>

es.read.field.as.array.include is a finicky property that can cause some very confusing serialization errors in the connector. Can you post a mapping and an average document that you're trying to read? Are the `c.d.e` fields meant to be treated as 3 nested arrays?

---

<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 11, 2020, 8:09pm UTC](https://discuss.elastic.co/t/es-read-field-as-array-include-multiple-values/231812/3 "2020-06-11T20:09:01Z")

</div>

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