You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/01/29 02:57:00 UTC

[jira] [Updated] (CALCITE-4800) Add SortToSortUnifyRule in SubstitutionVisitor

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

ASF GitHub Bot updated CALCITE-4800:
------------------------------------
    Labels: pull-request-available  (was: )

> Add SortToSortUnifyRule in SubstitutionVisitor
> ----------------------------------------------
>
>                 Key: CALCITE-4800
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4800
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: xzh_dz
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> In my project, there are more usage scenarios for materialized view recognition, and the `Sort Operator` can help sort data sets.But it has not been supported yet.A `Sort Operator` failed example can be reproduced as follows.
> {code:java}
> // code placeholder
> org.apache.calcite.test.MaterializedViewSubstitutionVisitorTest
> @Test void testSortToSort() {
>   final String mv = ""
>       + "select \"name\", \"deptno\"\n"
>       + "from \"emps\"\n"
>       + "order by \"deptno\"";
>   final String query = ""
>       + "select \"name\", \"deptno\"\n"
>       + "from \"emps\"\n"
>       + "order by \"deptno\" desc";
>   sql(mv, query).withChecker(
>       resultContains(""
>           + "EnumerableTableScan(table=[[hr, MV0]])")).ok();
> }
> {code}
> Exception:
> {code:java}
> // code placeholder
> Materialized view failed to be matched by optimized results:Materialized view failed to be matched by optimized results:
> java.lang.AssertionError: Materialized view failed to be matched by optimized results:
>  at org.apache.calcite.test.AbstractMaterializedViewTest.checkMaterialize(AbstractMaterializedViewTest.java:116) at org.apache.calcite.test.AbstractMaterializedViewTest.access$000(AbstractMaterializedViewTest.java:67) at org.apache.calcite.test.AbstractMaterializedViewTest$Sql.ok(AbstractMaterializedViewTest.java:229) at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) at org.apache.calcite.util.ImmutableBeans.lambda$makeDef$3(ImmutableBeans.java:299)
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)