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

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

> Can't apply materialized view with a simple sort
> ------------------------------------------------
>
>                 Key: CALCITE-3626
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3626
>             Project: Calcite
>          Issue Type: Wish
>            Reporter: xzh_dz
>            Priority: Major
>              Labels: pull-request-available
>
> when i run those codes as below, i get some error messages.it seems likeĀ 
> materialized view can not be matched correctly.
> code:
> {code:java}
> @Test public void testSort0() {
>     String mv = "select \"deptno\", \"commission\" from \"emps\" order by 
> \"deptno\"";
>     String query = "select \"deptno\" , \"commission\" from \"emps\" order by 
> \"commission\"";
>     checkMaterialize(mv, query, true);
>   }
> {code}
> {code:java}
> @Test public void testSort1() {
>     String mv = "select \"deptno\", \"commission\" from \"emps\" order by 
> \"deptno\"";
>     String query = "select \"commission\", \"deptno\"  from \"emps\" order by 
> \"commission\"";
>     checkMaterialize(mv, query, true);
>   }
> {code}
> exception:
> java.lang.AssertionError: 
> Expected: a string containing "EnumerableTableScan(table=[[hr, m0]])"
>      but: was "PLAN=EnumerableSort(sort0=[$0], dir0=[ASC])\n  
> EnumerableCalc(expr#0..4=[{inputs}], commission=[$t4], deptno=[$t1])\n    
> EnumerableTableScan(table=[[hr, emps]])\n\n"
> <Click to see difference>
>       at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
>       at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:6)
>       at 
> org.apache.calcite.test.CalciteAssert.lambda$checkResultContains$7(CalciteAssert.java:429)
>       at 
> org.apache.calcite.test.CalciteAssert.assertQuery(CalciteAssert.java:544)
>       at 
> org.apache.calcite.test.CalciteAssert$AssertQuery.lambda$returns$1(CalciteAssert.java:1514)
>       at 
> org.apache.calcite.test.CalciteAssert$AssertQuery.withConnection(CalciteAssert.java:1446)



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

Reply via email to