You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Vineet Garg (Jira)" <ji...@apache.org> on 2020/03/15 22:49:00 UTC
[jira] [Created] (CALCITE-3862) Rewriting for materialized view
consisting of group by on join keys with aggregate fails
Vineet Garg created CALCITE-3862:
------------------------------------
Summary: Rewriting for materialized view consisting of group by on join keys with aggregate fails
Key: CALCITE-3862
URL: https://issues.apache.org/jira/browse/CALCITE-3862
Project: Calcite
Issue Type: Bug
Components: core
Reporter: Vineet Garg
Assignee: Vineet Garg
*Repro*
{code:sql}
+ sql("select \"deptno\", \"empid\", \"salary\", sum(1) "
+ + "from \"emps\"\n"
+ + "group by \"deptno\", \"empid\", \"salary\"",
+ "select sum(1) "
+ + "from \"emps\"\n"
+ + "join \"depts\" on \"depts\".\"deptno\" = \"empid\" group by \"empid\", \"depts\".\"deptno\"")
+ .withResultContains(
+ "EnumerableCalc(expr#0..1=[{inputs}], EXPR$0=[$t1])\n"
+ + " EnumerableAggregate(group=[{1}], EXPR$0=[$SUM0($3)])\n"
+ + " EnumerableHashJoin(condition=[=($1, $4)], joinType=[inner])\n"
+ + " EnumerableTableScan(table=[[hr, m0]])")
+ .ok();
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)