LuciferYang opened a new pull request, #10223:
URL: https://github.com/apache/paimon/pull/10223

   ### Purpose
   
   `FieldIgnoreRetractAgg` overrides `agg`, `reset` and `retract` but not 
`aggReversed`, so it inherits `FieldAggregator`'s default which swaps the 
arguments and calls `agg(inputField, accumulator)`. When ignore-retract wraps a 
distinct `FieldCollectAgg`, the swap pushes the raw input array into the 
accumulator position, where `agg` dumps it unscanned via `collect()` instead of 
`collectWithEqualiser()`, so duplicate elements survive a distinct collect. 
This path is reached from `PartialUpdateMergeFunction.updateWithSequenceGroup` 
when a sequence group carries non-monotonic sequence values, which is exactly 
when reversed aggregation runs.
   
   This delegates `aggReversed` to the wrapped aggregator so the wrapper stays 
a transparent passthrough for aggregation and only alters retraction.
   
   ### Tests
   
   Added `FieldAggregatorTest.testFieldIgnoreRetractDelegatesAggReversed`. It 
wraps a distinct binary `FieldCollectAgg` in `FieldIgnoreRetractAgg` and 
asserts `aggReversed` de-duplicates the input so a distinct collect keeps one 
copy of each element. The test fails on current master because the duplicate 
survives, and passes with this fix.
   
   ### API and Format
   
   No.
   
   ### Documentation
   
   No.
   


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