You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2021/09/26 09:41:36 UTC

[GitHub] [calcite] yanlin-Lynn commented on a change in pull request #2542: [CALCITE-4801] SubstitutionVisitor support query pull up no-equal filter, when mv's aggregate rollup to query's aggregate(xurenhe)

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



##########
File path: core/src/test/java/org/apache/calcite/test/MaterializedViewSubstitutionVisitorTest.java
##########
@@ -1041,6 +1041,77 @@
         + "where \"name\" = 'hello'";
     sql(mv, query).ok();
   }
+
+  @Test void testNoEqualFilterInAgg1() {
+    final String mv = ""
+        + "select \"name\", count(distinct \"deptno\") as cnt\n"
+        + "from \"emps\" group by \"name\"";
+    final String query = ""
+        + "select count(distinct \"deptno\") as cnt\n"
+        + "from \"emps\" where \"name\" <> 'hello'";
+    sql(mv, query).withChecker(
+        resultContains(""
+            + "LogicalCalc(expr#0..1=[{inputs}], expr#2=['hello':VARCHAR], expr#3=[CAST($t0):VARCHAR], "
+            + "expr#4=[<>($t2, $t3)], CNT=[$t1], $condition=[$t4])\n"
+            + "  EnumerableTableScan(table=[[hr, MV0]])")).ok();
+  }

Review comment:
       this is not correct!




-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org