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

   @terrymanu I have addressed P1 in the latest revision:
   
   - Expression Evaluation for Synthetic Rows: I extracted the expression 
evaluation logic into a helper method (evaluateExpressionValue) and now 
explicitly call it on the synthetic MemoryQueryResultRow generated in 
getMemoryResultSetRows(...) when dataMap is empty.
   - Array Sizing Fix: To support the evaluation, I updated 
generateReturnData(...) to dynamically size the synthetic row's backing array 
based on the maximum column index of all aggregations (including derived ones). 
This ensures that the LightweightExpressionEvaluator can successfully fetch 
derived columns (such as the inner SUM) without throwing an 
IllegalArgumentException.
   - Regression Test: Added assertMergeWithEmptyResultAndIfNullExpression to 
verify that an empty routed result set correctly evaluates the fallback value 
(returning 0) for this exact no-row / no-GROUP BY scenario.


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