# Read.field.include with nested field doesnot really work

**URL:** <https://discuss.elastic.co/t/read-field-include-with-nested-field-doesnot-really-work/147180>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [September 4, 2018, 9:50am UTC](https://discuss.elastic.co/t/read-field-include-with-nested-field-doesnot-really-work/147180 "2018-09-04T09:50:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [September 4, 2018, 9:50am UTC](https://discuss.elastic.co/t/read-field-include-with-nested-field-doesnot-really-work/147180/1 "2018-09-04T09:50:54Z")

</div>

```
CREATE TEMPORARY TABLE trips USING org.elasticsearch.spark.sql OPTIONS (
    nodes "....", port "80", 
    resource "events-2018.09.03/events", 
    read.field.include "client.browser.os"
)

```

`select client.browser.os from trips limit 10`

This is working fine, but, the generated elasticsearch query is:

```
{
	"slice": {
		"id": 20,
		"max": 21
	},
	"query": {
		"match_all": {}
	},
	"_source": ["client"]
}

```

Why `_source` is not : `client.browser.os` ?

---

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [September 4, 2018, 2:33pm UTC](https://discuss.elastic.co/t/read-field-include-with-nested-field-doesnot-really-work/147180/2 "2018-09-04T14:33:20Z")

</div>

It seems that Spark is not giving the nested field when calling the plugin "buildScan(requiredColumn ...)" method, so the plugin doesnt know.

So this means push down is not working with nested fields?

I see MongoDB has fixed this error: [https://github.com/Stratio/Spark-MongoDB/blob/master/spark-mongodb/src/main/scala/com/stratio/datasource/mongodb/MongodbRelation.scala#L149](https://github.com/Stratio/Spark-MongoDB/blob/master/spark-mongodb/src/main/scala/com/stratio/datasource/mongodb/MongodbRelation.scala#L149)

---

<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:** [October 2, 2018, 2:33pm UTC](https://discuss.elastic.co/t/read-field-include-with-nested-field-doesnot-really-work/147180/3 "2018-10-02T14:33:20Z")

</div>

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