Reo-LEI commented on a change in pull request #2863:
URL: https://github.com/apache/iceberg/pull/2863#discussion_r695856538



##########
File path: 
flink/src/main/java/org/apache/iceberg/flink/sink/BaseDeltaTaskWriter.java
##########
@@ -69,6 +72,9 @@ public void write(RowData row) throws IOException {
 
     switch (row.getRowKind()) {
       case INSERT:
+        if (upsert) {
+          writer.delete(row);
+        }

Review comment:
       As @openinx mentioned in 
https://github.com/apache/iceberg/pull/1996#issue-546072705, we need to 
transform INSERT/UPDATE_AFTER to be UPSERT(delete + insert). If we don't add a 
delete on INSERT row when upsert mode is enable, we will get duplicate rows for 
same primary key.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to