jinxing64 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_r306222697
##########
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:
THX for look into this @hsyuan
I will update soon.
----------------------------------------------------------------
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