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