drghdtjr opened a new pull request, #37722: URL: https://github.com/apache/shardingsphere/pull/37722
PR Body Fixes #37644 Changes proposed in this pull request: Currently, ShardingSphere fails to merge results when aggregation functions are nested within expressions (e.g., IFNULL(SUM(amount), 0)). This is because the ResultMerger does not "see" the internal SUM hidden inside the ExpressionProjectionSegment. To resolve this, I have implemented the following changes: Recursive Extraction in Binder: Refactored ProjectionSegmentBinder to recursively traverse the ExpressionSegment tree. This ensures that all nested AggregationProjectionSegment units are identified, regardless of their depth within functions. Metadata Population: Updated ExpressionProjectionSegment to store these extracted nested aggregations, making them available for the context phase. Context Expansion: Enhanced ProjectionsContext to include these nested aggregations in the final merging plan, ensuring ResultMerger processes them correctly. -- 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]
