yanlin-Lynn commented on a change in pull request #1670: [CALCITE-3495]
RelDecorrelator generate plan with different semantics when handle Aggregate
URL: https://github.com/apache/calcite/pull/1670#discussion_r359192505
##########
File path: core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java
##########
@@ -457,6 +468,12 @@ public Frame decorrelateRel(Aggregate rel) {
// Aggregate itself should not reference corVars.
assert !cm.mapRefRelToCorRef.containsKey(rel);
+ for (AggregateCall call : rel.getAggCallList()) {
+ if (aggFunctionNotFitToDecorrelate(call.getAggregation())) {
+ return null;
+ }
+ }
Review comment:
@hsyuan , yes, we can allow that when group key is not empty. I add a test
case for that.
@jinxing64 RelDecorrelator.decorrelateQuery is a public method, user may
call it directly. So, I would perfer to fail the decorrelation. But, your
concern is valid, so I add the check for UDAF. How about that.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services