You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Vineet Garg (Jira)" <ji...@apache.org> on 2020/03/09 22:29:00 UTC

[jira] [Created] (CALCITE-3848) Materialized view rewriting fails for mv consisting of group by on join keys

Vineet Garg created CALCITE-3848:
------------------------------------

             Summary: Materialized view rewriting fails for mv consisting of group by on join keys
                 Key: CALCITE-3848
                 URL: https://issues.apache.org/jira/browse/CALCITE-3848
             Project: Calcite
          Issue Type: Bug
          Components: core
            Reporter: Vineet Garg
            Assignee: Vineet Garg


Test case
{code:java}
+  @Test public void testAggregateOnJoinKeys() {
+    checkMaterialize(
+        "select \"deptno\", \"empid\", \"salary\"\n"
+            + "from \"emps\"\n"
+            + "group by \"deptno\", \"empid\", \"salary\"",
+     "select \"empid\", \"depts\".\"deptno\" \n"
+        + "from \"emps\"\n"
+        + "join \"depts\" on \"depts\".\"deptno\" = \"empid\" group by \"empid\", \"depts\".\"deptno\"",
+        HR_FKUK_MODEL,
+        CalciteAssert.checkResultContains(
+            "EnumerableCalc(expr#0=[{inputs}], empid=[$t0], empid0=[$t0])\n"
+              + "  EnumerableAggregate(group=[{1}])\n"
+                + "    EnumerableHashJoin(condition=[=($1, $3)], joinType=[inner])\n"
+                + "      EnumerableTableScan(table=[[hr, m0]])"));
+  }
+
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)