[ https://issues.apache.org/jira/browse/CALCITE-4734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Hyde updated CALCITE-4734: --------------------------------- Fix Version/s: 1.28.0 > If there are duplicate RexNode in MutableCalc, SubstitutionVisitor should > return right rebuild RexNode > ------------------------------------------------------------------------------------------------------ > > 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 > Fix For: 1.28.0 > > Attachments: image-2021-08-13-11-43-54-035.png, > image-2021-08-13-11-44-09-504.png > > Time Spent: 1.5h > 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)