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)