yanlin-Lynn commented on a change in pull request #2529:
URL: https://github.com/apache/calcite/pull/2529#discussion_r716203498



##########
File path: 
core/src/test/java/org/apache/calcite/test/MaterializedViewSubstitutionVisitorTest.java
##########
@@ -1691,6 +1691,44 @@ private void checkSatisfiable(RexNode e, String s) {
             + "EnumerableTableScan(table=[[hr, MV0]])")).ok();
   }
 
+  /** Test case for
+   * <a 
href="https://issues.apache.org/jira/browse/CALCITE-4779";>[CALCITE-4779]
+   * GroupSet contains {@link RexLiteral}, materialized view recognition 
failed</a>. */
+  @Test void testGroupByListContainsConstantLiteral() {
+    // A query that groups by a literal and no columns.
+    final String mv0 = ""
+        + "select \"deptno\", \"empid\"\n"
+        + "from \"emps\"\n"
+        + "group by \"deptno\", \"empid\"";
+    final String query0 = ""
+        + "select 'a'\n"
+        + "from \"emps\"\n"
+        + "group by 'a'";
+    sql(mv0, query0).noMat();
+
+    // Aggregate operator grouping set contains a literal and count(distinct 
col) function.
+    final String mv1 = ""
+        + "select \"deptno\", \"empid\"\n"
+        + "from \"emps\"\n"
+        + "group by \"deptno\", \"empid\"";

Review comment:
       mv0 and mv1 is the same.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to