mihaibudiu commented on code in PR #5052:
URL: https://github.com/apache/calcite/pull/5052#discussion_r3523659062
##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -5935,8 +5927,18 @@ private SqlNode rewriteOuterAggregate(SqlNode
originalQuery,
validateQuery(newQuery, parentScope, unknownType);
final SqlNode scalarSubQuery =
SqlStdOperatorTable.SCALAR_QUERY.createCall(newQuery.getParserPosition(),
newQuery);
- return SqlStdOperatorTable.MULTIPLY.createCall(
- aggCall.getParserPosition(), aggCall, scalarSubQuery);
+ // Rewrite to CASE WHEN (SELECT 1 FROM ... LIMIT 1) IS NOT NULL THEN <agg>
END.
+ // This is type-agnostic (unlike multiplication, which only works for
Review Comment:
why mention here multiplication?
no one cares about prior incorrect implementations
Please, please, review the changes you submit for review before submitting
them.
--
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]