thswlsqls opened a new pull request, #39860:
URL: https://github.com/apache/shardingsphere/pull/39860

   
   Fixes #39859.
   
   Changes proposed in this pull request:
     - `GroupConcatAggregationUnit.getResult()` and 
`DistinctGroupConcatAggregationUnit.getResult()` now return null when no 
non-NULL value was merged, instead of the empty string produced by 
`String.join` over an empty collection.
     - MySQL `GROUP_CONCAT` returns NULL if there are no non-NULL values; a 
single-shard route already returned NULL, so multi-shard merging returned a 
different result for the same data.
     - Aligns with the other aggregation units in `features/sharding/core` 
(`AccumulationAggregationUnit`, `ComparableAggregationUnit`, 
`AverageAggregationUnit`, `BitXorAggregationUnit`, 
`DistinctSumAggregationUnit`, `DistinctAverageAggregationUnit`), which return 
null when nothing was merged; `GroupByStreamMergedResult` and 
`MemoryMergedResult` already map a null result to `wasNull`.
     - Adds `assertGroupConcatAggregationWithAllNullValues` and 
`assertDistinctGroupConcatAggregationWithAllNullValues` to 
`GroupConcatAggregationUnitTest`.
     - Adds a Bug Fixes entry to `RELEASE-NOTES.md`.
     - Related: the merge units were introduced in #33808.
     - Verified locally with `./mvnw spotless:apply`, `checkstyle:check`, 
`apache-rat:check` (`-Pcheck -pl features/sharding/core`) and `./mvnw install 
-pl features/sharding/core -am` (885 tests, 0 failures); E2E cases in 
`test/e2e/sql` were not run.
   
   AI assistance: Claude Code was used to draft the change and its unit tests 
in `features/sharding/core` (`GroupConcatAggregationUnit`, 
`DistinctGroupConcatAggregationUnit`, `GroupConcatAggregationUnitTest`) and the 
`RELEASE-NOTES.md` entry. I reviewed, verified, and take responsibility for 
every line submitted.
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following 
options:
   - [x] My code follows the [code of 
conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) 
of this project.
   - [x] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the 
pull request.
   - [ ] I have passed maven check locally : `./mvnw clean install -B -T1C 
-Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`. Ran the module-scoped equivalent 
instead: `./mvnw install -pl features/sharding/core -am -B -T1C 
-Dmaven.javadoc.skip -Dmaven.jacoco.skip -e` plus `spotless:apply`, 
`checkstyle:check` and `apache-rat:check` with `-Pcheck -T1C -pl 
features/sharding/core`.
   - [ ] I have made corresponding changes to the documentation. No 
documentation describes this merge behavior.
   - [x] I have added corresponding unit tests for my changes.
   - [x] I have updated the Release Notes of the current development version. 
For more details, see [Update Release 
Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
   - [x] I have disclosed the tool and affected files or scope for any material 
AI assistance, as required by the [AI-assisted contribution policy].
   
   [AI-assisted contribution policy]: 
https://github.com/apache/shardingsphere/blob/master/AI_POLICY.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