somiljain2006 commented on PR #38990:
URL: https://github.com/apache/shardingsphere/pull/38990#issuecomment-4903126847

   @terrymanu Thanks for the detailed review.
   
   I've addressed the remaining DISTINCT rewrite concern by making 
expression-derived AggregationDistinctProjections participate in the same 
rewrite path as top-level DISTINCT aggregations. Specifically, 
ProjectionsContext#getAggregationDistinctProjections() now also includes 
DISTINCT projections from expressionDerivedAggregations, allowing both 
ShardingDistinctProjectionPrefixTokenGenerator and 
ShardingAggregationDistinctTokenGenerator to process them through the existing 
rewrite contract instead of relying only on the append-only expression-derived 
projection path.
   
   I've also added regression tests covering:
   
   SQL token generation for expression-derived SUM(DISTINCT ...) / AVG(DISTINCT 
...) wrapped by IFNULL/COALESCE.
   A two-shard duplicate-value merge case verifying that DISTINCT semantics are 
preserved during cross-shard aggregation.


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