Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
Description
In current code, below matching fails:
MV: select deptno, sum(salary) + 2, sum(commission) from emps group by deptno Query: select deptno, sum(salary) + 2 from emps group by deptno
The reason is that – after matching of the Aggregates, a compensating Project is added, but afterwards matching fails to handle it.
This issue proposes to add a rule that match when query and target are both Project and query has a compensating Project as a child. After this issue below case can be handled:
Query: Project(projects: [$0, +($1, 2)]) Project(projects: [$1, $3, $4]) Rel-A Target: Project(projects: [$1, +($3, 2)]) Rel-A
Attachments
Issue Links
- relates to
-
CALCITE-3334 Refinement for Substitution-Based MV Matching
- Closed
- links to