jcamachor commented on a change in pull request #1852: [CALCITE-3848] Materialized view rewriting fails for mv consisting of group by on join keys (Vineet Garg) URL: https://github.com/apache/calcite/pull/1852#discussion_r390039710
########## File path: core/src/test/java/org/apache/calcite/test/MaterializationTest.java ########## @@ -2515,6 +2515,22 @@ private void checkSatisfiable(RexNode e, String s) { .ok(); } + @Test public void testAggregateOnJoinKeys() { + sql("select \"deptno\", \"empid\", \"salary\" " + + "from \"emps\"\n" + + "group by \"deptno\", \"empid\", \"salary\"", + "select \"empid\", \"depts\".\"deptno\" " + + "from \"emps\"\n" + + "join \"depts\" on \"depts\".\"deptno\" = \"empid\" group by \"empid\", \"depts\".\"deptno\"") + .withResultContains( + "EnumerableCalc(expr#0=[{inputs}], empid=[$t0], empid0=[$t0])\n" + + " EnumerableAggregate(group=[{1}])\n" + + " EnumerableHashJoin(condition=[=($1, $3)], joinType=[inner])\n" + + " EnumerableTableScan(table=[[hr, m0]])") + .ok(); + } + + Review comment: Remove \n ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services