# Elasticsearch Hadoop id mapping can't handle big number?

**URL:** <https://discuss.elastic.co/t/elasticsearch-hadoop-id-mapping-cant-handle-big-number/125296>\
**Category:** Elasticsearch\
**Created:** [March 23, 2018, 2:20am UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-id-mapping-cant-handle-big-number/125296 "2018-03-23T02:20:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![unruledboy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/unruledboy/32/28797_2.png) [@unruledboy](https://discuss.elastic.co/u/unruledboy)\
**Post date:** [March 23, 2018, 2:20am UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-id-mapping-cant-handle-big-number/125296/1 "2018-03-23T02:20:53Z")

</div>

Hi,

I save RDD to Elasticsearch via Scala like this:

EsSpark.saveJsonToEs(rdd, index, Map(  
"es.mapping.id" -\> "IncrementalId"))

When the IncrementalId is small number (like less than 1 billion), the id mapping is fine. But when the IncrementalId is a lot bigger (generated using Snowflake algo), then it became wrong, like this:

```
IncrementalId | Mapped Id in Es ( _id )
106640324646928380 | "106640324646928384"
106640324661608450 | "106640324661608448"
106640324677337090 | "106640324677337088"

```

Just a few number bigger/smaller

Is it possible Es not being able to handle big number like this when doing the id mapping?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 23, 2018, 2:35am UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-id-mapping-cant-handle-big-number/125296/2 "2018-03-23T02:35:20Z")

</div>

What did you map it as?

---

<div class="post-metadata">

**Author:** ![unruledboy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/unruledboy/32/28797_2.png) [@unruledboy](https://discuss.elastic.co/u/unruledboy)\
**Post date:** [March 23, 2018, 3:27am UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-id-mapping-cant-handle-big-number/125296/3 "2018-03-23T03:27:25Z")

</div>

Hi, IncrementalId is a big int, and I did not specify any other mapping, the meta "\_id" value is string.

I did the test for over 10,000 documents, they all have the same problem. I assume you can simply reproduce it by specifying a big integer number like 106640324646928380 and use "es.mapping.id" to map to the unique \_id meta value and see.

---

<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:** [April 20, 2018, 3:27am UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-id-mapping-cant-handle-big-number/125296/4 "2018-04-20T03:27:26Z")

</div>

Closed on April 20, 2018, 3:27am UTC

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