[
https://issues.apache.org/jira/browse/CALCITE-3626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stamatis Zampetakis resolved CALCITE-3626.
------------------------------------------
Fix Version/s: 1.22.0
Resolution: Duplicate
> 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
> Fix For: 1.22.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> 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)