# How to get around the problem with Incompatible types found in multi-mapping during reading data by Spark from Elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-to-get-around-the-problem-with-incompatible-types-found-in-multi-mapping-during-reading-data-by-spark-from-elasticsearch/251389>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [October 8, 2020, 7:48am UTC](https://discuss.elastic.co/t/how-to-get-around-the-problem-with-incompatible-types-found-in-multi-mapping-during-reading-data-by-spark-from-elasticsearch/251389 "2020-10-08T07:48:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlubom](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@dlubom](https://discuss.elastic.co/u/dlubom)\
**Post date:** [October 8, 2020, 7:48am UTC](https://discuss.elastic.co/t/how-to-get-around-the-problem-with-incompatible-types-found-in-multi-mapping-during-reading-data-by-spark-from-elasticsearch/251389/1 "2020-10-08T07:48:03Z")

</div>

How to get around this problem (without reindexing):

```auto
Py4JJavaError: An error occurred while calling o2649.load.
: org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Incompatible types found in multi-mapping: Field [metadata.cscope.0] has conflicting types of [LONG] and [OBJECT].

```

I try to exclude this field by es.read.field.exclude but not help.

My reading:

```auto
reader = spark.read.format("org.elasticsearch.spark.sql") \
    .option("es.port", "9200") \
    .option("spark.es.net.http.auth.user", "") \
    .option("spark.es.net.http.auth.pass", "") \
    .option("es.nodes.wan.only", "true") \
    .option("es.mapping.date.rich", "false") \
    .option("es.http.timeout", "3m") \
    .option("es.read.field.include", "log") \
    .option("es.read.field.exclude", "metadata*") \
    .option("es.read.metadata", "false") \
    .option("es.nodes", IP)

df = reader.load(INDEX_NAME)

```

Spark ver. 2.4.5  
Lib: elasticsearch-spark-20\_2.11-7.6.2.jar

---

<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:** [November 5, 2020, 7:48am UTC](https://discuss.elastic.co/t/how-to-get-around-the-problem-with-incompatible-types-found-in-multi-mapping-during-reading-data-by-spark-from-elasticsearch/251389/2 "2020-11-05T07:48:06Z")

</div>

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