JingsongLi commented on code in PR #11178:
URL: https://github.com/apache/paimon/pull/11178#discussion_r4624255110


##########
paimon-core/src/main/java/org/apache/paimon/mergetree/compact/PartialUpdateMergeFunction.java:
##########
@@ -431,7 +444,12 @@ public KeyValue getResult() {
             reused = new KeyValue();
         }
 
-        RowKind rowKind = currentDeleteRow || !meetInsert ? RowKind.DELETE : 
RowKind.INSERT;
+        RowKind rowKind;
+        if (currentDeleteRow) {
+            rowKind = meetDelete ? RowKind.DELETE : RowKind.UPDATE_BEFORE;

Review Comment:
   [P1] The same valid input can lose another writer's column depending on an 
extra memtable flush. I reproduced this on a real fixed-bucket partial-update 
table with `write-only=true`, `partial-update.remove-record-on-delete=true`, 
and no sequence groups. Commit `+I(1,NULL,20)`, then in the next commit write 
`-D(1,5,NULL), +I(1,10,NULL), -U(1,10,NULL)`, flush, and write `+U(1,11,NULL)`. 
This branch reads `(1,11,NULL)`. Adding one extra flush immediately after 
`+I(1,10,NULL)` reads `(1,11,20)`. Both layouts read `(1,11,20)` with the base 
implementation. `meetDelete` persists within a buffer, but an INSERT result 
does not preserve it across one; the final `-U` therefore emits DELETE in one 
layout and UPDATE_BEFORE in the other. Please add a real-table regression for 
this mixed DELETE/UPDATE_BEFORE sequence and make the result invariant across 
flush boundaries.



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