jinxing64 commented on a change in pull request #1307: [CALCITE-3182] Trim
unused fields for plan of materialized-view before matching.
URL: https://github.com/apache/calcite/pull/1307#discussion_r301412588
##########
File path: core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java
##########
@@ -495,8 +495,9 @@ assert equalType(
for (MutableRel targetDescendant : targetDescendants) {
MutableRel queryDescendant = map.get(targetDescendant);
if (queryDescendant != null) {
- assert queryDescendant.rowType.equals(targetDescendant.rowType);
- equivalents.put(queryDescendant, targetDescendant);
Review comment:
@DonnyZone
I added a test
```
@Test public void testAggregate1() {
checkMaterialize(
"select \"deptno\", count(*) as c, sum(\"empid\") as s from \"emps\"
group by \"deptno\"",
"select count(*) + 1 as c, \"deptno\" from \"emps\" group by
\"deptno\"");
}
```
As I removed the row-type checking, exception is not thrown now. Given
existing substitution rules, materialization and query above can match with
each other.
But the matching process is not ideal and the `Aggregation` operators from
materialization and query is not taken as equivalent at the start --
CALCITE-3113 is tracking now
----------------------------------------------------------------
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