PyRSA opened a new pull request, #8480:
URL: https://github.com/apache/paimon/pull/8480
### Purpose
[Fix] Ignore blank input values when using
field.{fieldName}.aggregate-function=listagg
Expected behavior
| Case | Input A | Input B | Current Output | Expected Output |
|------|---------|---------|----------------|-----------------|
| listagg | `'user1,user2,user3'` | `''` (empty string) |
`'user1,user2,user3,'` ❌ | `'user1,user2,user3'` |
| listagg | `'user1,user2,user3'` | `' '` (space) | `'user1,user2,user3, '`
❌ | `'user1,user2,user3'` |
| listagg | `'user1,user2,user3'` | `'\t'` (tab) | `'user1,user2,user3,\t'`
❌ | `'user1,user2,user3'` |
| listagg | `'user1,user2,user3'` | `'\n'` (newline) |
`'user1,user2,user3,\n'` ❌ | `'user1,user2,user3'` |
| listagg | `'user1,user2,user3'` | `'\r'` (carriage return) |
`'user1,user2,user3,\r'` ❌ | `'user1,user2,user3'` |
| listagg | `' '` (whitespace only) | `'user1,user2,user3'` | `'
,user1,user2,user3'` ❌ | `'user1,user2,user3'` |
Blank values are determined using
`org.apache.paimon.utils.StringUtils.StringUtils.isBlank(...)`.
### Tests
-
org.apache.paimon.mergetree.compact.aggregate.FieldAggregatorTest#testFieldListAggWithDefaultDelimiterIgnoringBlankValues
-
org.apache.paimon.mergetree.compact.aggregate.FieldAggregatorTest#testFieldListAggWithDefaultDelimiterAndDistinctIgnoringBlankValues
--
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]