Skip to content

Add custom mapping configuration key #1539

Open
@jpgilaberte

Description

@jpgilaberte

What kind an issue is this?

  • Bug report. If you’ve found a bug, please provide a code snippet or test to reproduce it below.
    The easier it is to track down the bug, the faster it is solved.
  • Feature Request. Start by telling us what problem you’re trying to solve.
    Often a solution already exists! Don’t send pull requests to implement new features without
    first getting our support. Sometimes we leave features out on purpose to keep the project small.

Feature description

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:

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

Thank you very much

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions