You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/12/18 04:29:50 UTC

[GitHub] [calcite] hsyuan commented on a change in pull request #1670: [WIP][CALCITE-3495] RelDecorrelator generate plan with different semantics when handle Aggregate

hsyuan 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_r359147547
 
 

 ##########
 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:
   Should we allow count agg for subquery where the group key is not empty? e.g.
   `select * from foo where (a, b) in (select c, count(*) from bar where bar.d=foo.d group by c)`

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services