xuzifu666 commented on code in PR #5052:
URL: https://github.com/apache/calcite/pull/5052#discussion_r3523962674
##########
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:
Sorry for the unnecessary content in this change. I have removed that part.
--
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]