You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/09/03 11:35:13 UTC
[GitHub] [calcite] yanlin-Lynn commented on pull request #2117: [CALCITE-4182] Support mv recognition when query has constant filter for missing columns in group by list of mv
yanlin-Lynn commented on pull request #2117:
URL: https://github.com/apache/calcite/pull/2117#issuecomment-686428827
> Can this case be covered ?
>
> ```
> @Test void testConstantFilterInAgg2() {
> final String mv = ""
> + "select \"name\", \"deptno\", count(distinct \"commission\") as cnt\n"
> + "from \"emps\"\n"
> + " group by \"name\", \"deptno\"";
> final String query = ""
> + "select \"deptno\", count(distinct \"commission\") as cnt\n"
> + "from \"emps\" where \"name\" = 'hello' and \"deptno\" = 1\n"
> + "group by \"deptno\"";
> sql(mv, query).withChecker(
> resultContains(""
> + "LogicalCalc(expr#0..2=[{inputs}], expr#3=['hello':VARCHAR], expr#4=[CAST($t0)"
> + ":VARCHAR], expr#5=[=($t3, $t4)], deptno=[$t1], CNT=[$t2], $condition=[$t5])\n"
> + " EnumerableTableScan(table=[[hr, MV0]])")).ok();
> }
> ```
yes
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org