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/07/23 07:35:09 UTC

[GitHub] [calcite] hsyuan commented on a change in pull request #1324: [CALCITE-3203] When matching materializations, match Project with child of Aggregate

hsyuan commented on a change in pull request #1324: [CALCITE-3203] When matching materializations, match Project with child of Aggregate
URL: https://github.com/apache/calcite/pull/1324#discussion_r306167270
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/plan/MaterializedViewSubstitutionVisitor.java
 ##########
 @@ -259,6 +263,77 @@ public UnifyResult apply(UnifyRuleCall call) {
     }
   }
 
+  /**
+   * Implementation of {@link SubstitutionVisitor.UnifyRule} that matches a
+   * {@link MutableProject} on top of a {@link MutableAggregate} to a
+   * {@link MutableProject} on top of a {@link MutableAggregate}.
+   *
+   * <p>Example: aggregate calls of query is a subset of target.</p>
+   * <ul>
+   * <li>query:   Project(projects: [$0, *(2, $1)])
+   *                Aggregate(groupSet: {0}, groupSets: [{0}], calls: [SUM($1)])
+   *                  Scan(table: [hr, emps])</li>
+   * <li>target:  Project(projects: [$0, *(2, $1), *(2, $2)])
+   *                Aggregate(groupSet: {0}, groupSets: [{0}], calls: [SUM($1), COUNT()])
+   *                  Scan(table: [hr, emps])</li>
+   * </ul>
+   */
+  private static class ProjectOnAggregateToProjectOnAggregateUnifyRule
 
 Review comment:
   Maybe you can rename the rule name to `ProjectAggregateToProjectAggregateUnifyRule `

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