dawidwys commented on code in PR #27602:
URL: https://github.com/apache/flink/pull/27602#discussion_r2826495452


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/sink/WatermarkCompactingSinkMaterializer.java:
##########
@@ -473,13 +499,18 @@ private int findFirst(List<RowData> values, RowData 
target) {
     }
 
     private boolean equalsIgnoreRowKind(RowData newRow, RowData oldRow) {
+        RowKind originalKind = newRow.getRowKind();
         newRow.setRowKind(oldRow.getRowKind());
-        if (hasUpsertKey) {
-            return this.upsertKeyEqualiser.equals(
-                    upsertKeyProjectedRow1.replaceRow(newRow),
-                    upsertKeyProjectedRow2.replaceRow(oldRow));
+        try {
+            if (hasUpsertKey) {
+                return this.upsertKeyEqualiser.equals(
+                        upsertKeyProjectedRow1.replaceRow(newRow),
+                        upsertKeyProjectedRow2.replaceRow(oldRow));
+            }
+            return equaliser.equals(newRow, oldRow);
+        } finally {
+            newRow.setRowKind(originalKind);
         }

Review Comment:
   It's not a bugfix. In the old structure of `compactEmit` we didn't care 
about the original rowkind, because we never kept `DELETE` msgs, we only ever 
kept `INSERT`s. In the new approach we must keep deletions as well.



-- 
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]

Reply via email to