PyRSA commented on code in PR #11163:
URL: https://github.com/apache/paimon/pull/11163#discussion_r4583037421


##########
paimon-python/pypaimon/execution/python/read/reader/aggregate/aggregators.py:
##########
@@ -1021,15 +1024,31 @@ def _check_option_dependencies(
                 "requires 'fields.<field-name>.nested-key' to be configured."
             )
 
-        if (
-                options.field_nested_update_agg_nested_sequence_field(field)
-                and not nested_key
-        ):
+        nested_sequence_field = (
+            options.field_nested_update_agg_nested_sequence_field(field)
+        )
+        if nested_sequence_field and not nested_key:
             raise ValueError(
                 "Option 'fields.<field-name>.nested-sequence-field' "
                 "requires 'fields.<field-name>.nested-key' to be configured."
             )
 
+        overwrite_on_equal_configured = options.options.contains_key(
+            f"{CoreOptions.FIELDS_PREFIX}.{field}."
+            f"{CoreOptions.NESTED_SEQUENCE_OVERWRITE_ON_EQUAL}"
+        )
+        if overwrite_on_equal_configured and not nested_sequence_field:
+            raise ValueError(
+                "Option 
'fields.<field-name>.nested-sequence-overwrite-on-equal' "
+                "requires 'fields.<field-name>.nested-sequence-field' to be 
configured."
+            )
+
+    def _should_update(self, new_row: Record, old_row: Record) -> bool:
+        if not self.has_sequence_field:
+            return True
+        comparison = self._compare_sequence(new_row, old_row)
+        return comparison > 0 or (comparison == 0 and 
self.overwrite_on_equal_sequence)

Review Comment:
   Thanks for the review. This has been addressed.
   
   When any `nested_update` field explicitly sets 
`nested-sequence-overwrite-on-equal=false`, PyPaimon now disables the Native 
backend for both reads and writes and falls back to the Python implementation.
   
   Added real-table regression tests covering both paths:
   - **Read:** verifies that the Native reader is not initialized and the first 
value is retained for equal sequences.
   - **Write:** verifies that the Native writer is bypassed, then commits and 
reopens the table to confirm that the first value remains persisted.
   
   The default behavior and explicit `true` configuration remain eligible for 
Native execution.
   
   The targeted tests and lint checks pass.



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