[
https://issues.apache.org/jira/browse/CALCITE-4376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wang Yanlin updated CALCITE-4376:
---------------------------------
Summary: Materialized view recognition fails when target project different
columns with GROUP BY (was: Materialized view recognition fails when target
project different column sequence with GROUP BY)
> Materialized view recognition fails when target project different columns
> with GROUP BY
> ---------------------------------------------------------------------------------------
>
> Key: CALCITE-4376
> URL: https://issues.apache.org/jira/browse/CALCITE-4376
> Project: Calcite
> Issue Type: Bug
> Reporter: Wang Yanlin
> Assignee: Wang Yanlin
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> When target project a different column sequence with group by, materialized
> view recognition will fail, see the case below
> {noformat}
> @Test void testDifferentGroupBySequence() {
> final String mv = "" +
> "select \"deptno\", \"name\" from ("
> + "select \"name\", \"deptno\", \"commission\"\n"
> + "from \"emps\"\n"
> + " group by \"name\", \"deptno\", \"commission\") t";
> final String query = ""
> + "select \"deptno\", \"name\"\n"
> + "from \"emps\"\n"
> + "group by \"deptno\", \"name\"";
> sql(mv, query).withChecker(
> resultContains(""
> + "EnumerableTableScan(table=[[hr, MV0]])")).ok();
> }
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)