[
https://issues.apache.org/jira/browse/CALCITE-4182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wang Yanlin updated CALCITE-4182:
---------------------------------
Description:
Mv re
{noformat}
@Test void testConstantFilterInAgg() {
final String mv = ""
+ "select \"name\", count(distinct \"deptno\") as cnt\n"
+ "from \"emps\" group by \"name\"";
final String query = ""
+ "select count(distinct \"deptno\") as cnt\n"
+ "from \"emps\" where \"name\" = 'hello'";
sql(mv, query).ok();
}
{noformat}
was:
{noformat}
@Test void testConstantFilterInAgg() {
final String mv = ""
+ "select \"name\", count(distinct \"deptno\") as cnt\n"
+ "from \"emps\" group by \"name\"";
final String query = ""
+ "select count(distinct \"deptno\") as cnt\n"
+ "from \"emps\" where \"name\" = 'hello'";
sql(mv, query).ok();
}
{noformat}
> MV recognition fails when query has constant filter for group by list in mv,
> but without group by
> -------------------------------------------------------------------------------------------------
>
> Key: CALCITE-4182
> URL: https://issues.apache.org/jira/browse/CALCITE-4182
> Project: Calcite
> Issue Type: Bug
> Reporter: Wang Yanlin
> Priority: Major
>
> Mv re
> {noformat}
> @Test void testConstantFilterInAgg() {
> final String mv = ""
> + "select \"name\", count(distinct \"deptno\") as cnt\n"
> + "from \"emps\" group by \"name\"";
> final String query = ""
> + "select count(distinct \"deptno\") as cnt\n"
> + "from \"emps\" where \"name\" = 'hello'";
> sql(mv, query).ok();
> }
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)