[CALCITE-3203] When matching materializations, match Project with child of Aggregate#1324
[CALCITE-3203] When matching materializations, match Project with child of Aggregate#1324jinxing64 wants to merge 1 commit intoapache:masterfrom
Conversation
39233c4 to
45a0393
Compare
| * Scan(table: [hr, emps])</li> | ||
| * </ul> | ||
| */ | ||
| private static class ProjectOnAggregateToProjectOnAggregateUnifyRule |
There was a problem hiding this comment.
Maybe you can rename the rule name to ProjectAggregateToProjectAggregateUnifyRule
There was a problem hiding this comment.
THX for look into this @hsyuan
I will update soon.
…ld of Aggregate (Jin Xing)
|
Can you rebase on master? |
|
@hsyuan Actually I think this case can be covered by #1384 The matching pattern proposed in #1384 is like below: I think the second pattern is more general and I added the test case in this PR to #1384 If #1384 makes sense, it's great if you can shepherd and take a review when you have time. Then I will close this PR. Thanks ~ Jin |
|
This change can be covered by #1451 |
In current code,
SubstitutionVisitor&MaterializedViewSubstitutionVisitorfail to support below matching:And below test fails
The reason is that
Project&Aggregateare not taken into consideration at the same time in current matching rules.It might make sense to create a rule of
ProjectOnAggregateToProjectOnAggregateUnifyRuleto handle such case.