You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Haisheng Yuan (JIRA)" <ji...@apache.org> on 2019/08/16 21:22:00 UTC

[jira] [Resolved] (CALCITE-3249) Substitution#getRexShuttle does not consider RexLiteral

     [ https://issues.apache.org/jira/browse/CALCITE-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Haisheng Yuan resolved CALCITE-3249.
------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.21.0

Fixed in https://github.com/apache/calcite/commit/0a6f53cb828cd39d78d1423361921bf40636943a, thanks for the PR, [~jinxing6042@126.com]!

> Substitution#getRexShuttle does not consider RexLiteral
> -------------------------------------------------------
>
>                 Key: CALCITE-3249
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3249
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: jin xing
>            Assignee: jin xing
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.21.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Current {{Substitution#getRexShuttle}} does not take {{RexLiteral}} into consideration.
> Thus below query & mv fails matching:
> {code:java}
> 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
> {code}
> 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



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)