You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Feng Zhu (Jira)" <ji...@apache.org> on 2019/12/24 09:15:00 UTC

[jira] [Commented] (CALCITE-3626) Can't apply materialized view with a simple sort

    [ https://issues.apache.org/jira/browse/CALCITE-3626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17002744#comment-17002744 ] 

Feng Zhu commented on CALCITE-3626:
-----------------------------------

It is duplicate with CALCITE-771.

> 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
>
> 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)