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


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -5599,6 +5601,14 @@ 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
+    // over outer columns. The aggregate belongs to the outer query per SQL
+    // standard, but only if the current conformance allows this non-standard
+    // correlated-aggregate construct.
+    if (config.conformance().isCorrelatedAggregateAllowed()) {

Review Comment:
   Please read my review comments carefully. I had already suggested error 
handling in the previous iteration.
   My energy for reviews is limited. This is not the only thing that could have 
been done in fewer steps.



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