Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
Description
Current Substitution#getRexShuttle does not take RexLiteral into consideration.
Thus below query & mv fails matching:
MV: select deptno, sum(salary), sum(commission), sum(k) from (select deptno, salary, commission, 100 as k from emps) group by deptno Query: select deptno, sum(salary), sum(k) from (select deptno, salary, 100 as k from emps) group by deptno
The root cause is that ProjectToProjectUnifyRule compensates a Project which contains RexLiteral, but AggregateOnProjectToAggregateUnifyRule works only when the Project in query is a mapping
https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java#L1357
Attachments
Issue Links
- links to