xuzifu666 commented on code in PR #5052:
URL: https://github.com/apache/calcite/pull/5052#discussion_r3487199125
##########
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:
Apologies, and thank you for pointing this out. You are right — I should
have caught the error-handling requirement from your earlier comment instead of
needing a second reminder.
I will be more careful reading review comments in full going forwar.
--
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]