xuzifu666 commented on code in PR #5052:
URL: https://github.com/apache/calcite/pull/5052#discussion_r3534234031


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -5599,6 +5599,17 @@ protected RelDataType validateSelectList(final 
SqlNodeList selectItems,
     // First pass, ensure that aliases are unique. "*" and "TABLE.*" items
     // are ignored.
 
+    // Rewrite scalar sub-queries whose single select item is an aggregate

Review Comment:
   Furthermore, in my view the rewrite alters the structure of the SELECT list 
(replacing a scalar subquery with a `CASE WHEN ... THEN agg END` construct); 
ideally, this should be performed before the expansion and validation steps in 
`validateSelectList`. Please point out any errors in the analysis.



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