jinxing64 commented on a change in pull request #1670: [WIP][CALCITE-3495]
RelDecorrelator generate plan with different semantics when handle Aggregate
URL: https://github.com/apache/calcite/pull/1670#discussion_r359157451
##########
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:
Rather than failing the decorrelation when COUNT, do we consider just
disable decorrelation when subquery is an Aggregate?
Because user have the flexibility to define UDAF, it's hard to predicate the
Agg behavior or enumerate all types of Agg functions.
----------------------------------------------------------------
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