You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Wang Yanlin (Jira)" <ji...@apache.org> on 2021/09/01 06:35:00 UTC

[jira] [Resolved] (CALCITE-4734) Materialization-Failed, when meeting same projs in mv.

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

Wang Yanlin resolved CALCITE-4734.
----------------------------------
    Resolution: Fixed

> Materialization-Failed, when meeting same projs in mv.
> ------------------------------------------------------
>
>                 Key: CALCITE-4734
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4734
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Xurenhe
>            Priority: Critical
>              Labels: pull-request-available
>         Attachments: image-2021-08-13-11-43-54-035.png, image-2021-08-13-11-44-09-504.png
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Some user may define some not beautiful mv, but these mv should be worked for rewriting query.
> For example:
> {code:java}
>   @Test void testMoreSameExprInMv() {
>     final String mv = ""
>         + "select \"empid\", \"deptno\", sum(\"empid\") as s1, sum(\"empid\") as s2, count(*) as c\n"
>         + "from \"emps\" group by \"empid\", \"deptno\"";
>     final String query = ""
>         +  "select sum(\"empid\"), count(*) from \"emps\" group by \"empid\", \"deptno\"";
>     sql(mv, query).ok();
>   }
> {code}
> I try debug code to solve this problem.
> I find some bug in 
> {code:java}
> org.apache.calcite.plan.SubstitutionVisitor#getRexShuttle
> {code}
>  !image-2021-08-13-11-43-54-035.png|thumbnail! 
>  !image-2021-08-13-11-44-09-504.png|thumbnail! 
> PR: https://github.com/apache/calcite/pull/2484
> Please review, THX.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)