jackylee-ch commented on code in PR #10161:
URL: https://github.com/apache/paimon/pull/10161#discussion_r4180202992


##########
paimon-python/pypaimon/read/reader/partial_update_merge_function.py:
##########
@@ -92,16 +100,19 @@ def reset(self) -> None:
     def add(self, kv: KeyValue) -> None:
         row_kind_byte = kv.value_row_kind_byte
         if not RowKind.is_add_byte(row_kind_byte):
-            # DELETE / UPDATE_BEFORE require ignore-delete or
-            # partial-update.remove-record-on-delete to be enabled,
-            # and neither option is implemented in pypaimon yet, so
-            # refuse the row rather than silently swallow it.
+            if self._ignore_delete:
+                # ignore-delete: drop the retract row and keep merging the
+                # rest of the group, as Java PartialUpdateMergeFunction does.
+                return

Review Comment:
   Fixed in 1bc644521. add() now seeds the accumulator from the first retract 
before the ignore-delete short-circuit, mirroring Java 
initRow()/notNullColumnFilled, so a persisted DELETE's value survives a later 
partial INSERT that leaves the field unset. A retract-only group still yields 
no row: a new _meet_insert flag gates get_result(), matching Java's dropped 
RowKind.DELETE when !meetInsert. Added unit tests plus an end-to-end test over 
two overlapping level-0 KV files (retract-first then partial add) reading 
value=100 where the old code read null; reverting the seed reproduces the null.
   



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