[
https://issues.apache.org/jira/browse/CALCITE-3256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16964677#comment-16964677
]
Jin Xing commented on CALCITE-3256:
-----------------------------------
Duplicate with CALCITE-3334, close it.
> Add ProjectOnProjectToProjectUnifyRule for materialization matching.
> --------------------------------------------------------------------
>
> Key: CALCITE-3256
> URL: https://issues.apache.org/jira/browse/CALCITE-3256
> Project: Calcite
> Issue Type: Sub-task
> Components: core
> Reporter: Jin Xing
> Assignee: Jin Xing
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> In current code, below matching fails:
> {code:java}
> MV:
> select deptno, sum(salary) + 2, sum(commission)
> from emps
> group by deptno
> Query:
> select deptno, sum(salary) + 2
> from emps
> group by deptno
> {code}
> 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:
> {code:java}
> Query:
> Project(projects: [$0, +($1, 2)])
> Project(projects: [$1, $3, $4])
> Rel-A
> Target:
> Project(projects: [$1, +($3, 2)])
> Rel-A
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)