Writing data to database only Append to Overwrite, ErrorIfExists, Ignore this several patterns, how to update the original data, the general is how to deal with
CodePudding user response:
I wrote a insertOrUpdate, actual logic is a Dataset table structure is consistent with the target, specify a field as the id, foreachPartition operator within each record query whether there is the primary key at a time, if you have made the update (SQL) assembled, not just to insertThe most violent way is to delete + insert,,,,
CodePudding user response:
Suggest delete first, then insert, speed, the update wrong won't happen againCodePudding user response:
ForeachPartition operator within each record query whether there is the primary key at a time, how this kind of performance, if the target table has tens of millions of data, will this performance is very poor?CodePudding user response: