# \[HADOOP\] Add custom mapping configuration key

**URL:** <https://discuss.elastic.co/t/hadoop-add-custom-mapping-configuration-key/244179>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [August 7, 2020, 1:05pm UTC](https://discuss.elastic.co/t/hadoop-add-custom-mapping-configuration-key/244179 "2020-08-07T13:05:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpgilaberte](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@jpgilaberte](https://discuss.elastic.co/u/jpgilaberte)\
**Post date:** [August 7, 2020, 1:05pm UTC](https://discuss.elastic.co/t/hadoop-add-custom-mapping-configuration-key/244179/1 "2020-08-07T13:05:41Z")

</div>

Hi, maybe it makes sense to allow customizing the mapping in the creation of an index?

For example, when a table is created from SparkSql and the index does not exist, there could be a configuration option that allows custom creation of the index like this:

```auto
    CREATE TABLE testMapping (id int, name string, surname string) USING org.elasticsearch.spark.sql OPTIONS (
        es.resource 'testMapping',
        es.mapping.definition '{ "settings": {
                                               "number_of_shards": 3,
                                               "number_of_replicas": 2
                                             },
                                 "mappings": {
                                               "properties":{
                                                               "id": { "type": "integer" }
                                                            }
                                              }
                                 }',
        es.nodes '127.0.0.1',
        es.port '9200');

    insert into testMapping values (1, 'elastic', 'elastic-hadoop');

```

In my opinion, it does not have a great impact on the code and can make the solution much more flexible. The code could be something like this: [Custom mapping feature](https://github.com/jpgilaberte/elasticsearch-hadoop/commit/6d881f13d145d807cbb6d41ce545584664a12bc1)

Thank you very much

---

<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:** [September 4, 2020, 1:05pm UTC](https://discuss.elastic.co/t/hadoop-add-custom-mapping-configuration-key/244179/2 "2020-09-04T13:05:47Z")

</div>

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