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

   [core] Adjust distinct option in FieldListaggAgg operator
   
   ### Purpose
   
   1. [Fix] Fix `field.{fieldName}.aggregate-function=listagg` behavior when 
handling empty strings
   2. [Feature] Adjust `field.{fieldName}.distict` behavior when aggregating 
strings
   
   Expected behavior:
   
   | case               | Input A             | Input B             | Current 
Output                    | Expected Output           |
   | ------------------ | ------------------- | ------------------- | 
--------------------------------- | ------------------------- |
   | listagg            | `'user1,user2,user3'` | `''` (empty string)   | 
`'user1,user2,user3,'` ❌            | `'user1,user2,user3'`       |
   | listagg & distinct [#6566](https://github.com/apache/paimon/pull/6566) | 
`'user1,user2,user3'` | `'user1,user4'`       | 
`'user1,user2,user3,user1,user4'` ❌ | `'user1,user2,user3,user4'` |
   | listagg            | `''`  (empty string)  | `'user1,user2,user3'` | 
`',user1,user2,user3'`            ❌ | `'user1,user2,user3'`       |
   
   ### Tests
   
   - 
`org.apache.paimon.mergetree.compact.aggregate.FieldAggregatorTest#testFieldListAggWithDefaultDelimiterAndDistinct`
   - 
`org.apache.paimon.mergetree.compact.aggregate.FieldAggregatorTest#testFieldListAggWithDefaultDelimiterAndDistinctWithMultiUser`
   - 
`org.apache.paimon.mergetree.compact.aggregate.FieldAggregatorTest#testFieldListAggWithDefaultDelimiterAndDistinctWithEmptyLeftUser`
   - 
`org.apache.paimon.mergetree.compact.aggregate.FieldAggregatorTest#testFieldListAggWithDefaultDelimiterAndDistinctWithMultiKvString`
   - 
`org.apache.paimon.mergetree.compact.aggregate.FieldAggregatorTest#testFieldListAggWithDefaultDelimiterAndDistinctWithMultiDuplicatedKvString`
   
   ### API and Format
   
   No Changes.
   
   ### Documentation
   
   docs/content/primary-key-table/merge-engine/aggregation.md
   


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