elastic / elasticsearch-hadoop

:elephant: Elasticsearch real-time search and analytics natively integrated with Hadoop
https://www.elastic.co/products/hadoop
Apache License 2.0
10 stars 989 forks source link

When using spark df write es, script content and upsert cannot be executed simultaneously. #2278

Open MrAladdin opened 2 weeks ago

MrAladdin commented 2 weeks ago

1、 "es.write.operation" -> "upsert", "es.update.script.upsert" -> "true" "es.update.script.inline" -> "xxx" When executing df.write.format("org.elasticsearch.spark.sql"), fields in the DataFrame that are not involved in the script cannot be upserted. 2、 "es.write.operation" -> "upsert", "es.update.script.upsert" -> "false" "es.update.script.inline" -> "xxx" When executing df.write.format("org.elasticsearch.spark.sql"), if there is no corresponding ID data in Elasticsearch, it will perform a normal write of all fields. When executed a second time, the script content will be executed.

I understand that when es.update.script.upsert is enabled, the script (field a) and upsert (field b) can be executed in parallel simultaneously. It shouldn't be that only one of script or normal upsert of other fields can be chosen. Sorry, I couldn't find the relevant parameters either. When I tested it with Kibana, it was able to execute in parallel successfully.