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.
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 executingdf.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.