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/25 13:27:24 UTC

[GitHub] [calcite] wojustme opened a new pull request #2542: [CALCITE-4801] SubstitutionVisitor support query pull up no-equal filter, when mv's aggregate rollup to query's aggregate(xurenhe)

wojustme opened a new pull request #2542:
URL: https://github.com/apache/calcite/pull/2542


   Enhance SubstitutionVisitor, when query pull-up filter under aggregate, as [CALCITE-4801](https://issues.apache.org/jira/browse/CALCITE-4801) described.


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



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

Posted by GitBox <gi...@apache.org>.
wojustme commented on pull request #2542:
URL: https://github.com/apache/calcite/pull/2542#issuecomment-927401596


   Close it because of invalid [issue-4801](https://issues.apache.org/jira/browse/CALCITE-4801).


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



[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)

Posted by GitBox <gi...@apache.org>.
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



[GitHub] [calcite] wojustme 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)

Posted by GitBox <gi...@apache.org>.
wojustme commented on a change in pull request #2542:
URL: https://github.com/apache/calcite/pull/2542#discussion_r716285628



##########
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:
       Ok, it's really invalid.
   I will close it, thanks for your review.




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



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

Posted by GitBox <gi...@apache.org>.
wojustme commented on pull request #2542:
URL: https://github.com/apache/calcite/pull/2542#issuecomment-927121530


   Hi @hsyuan @yanlin-Lynn @xy2953396112 
   Please review this pr, if you have time.
   Thanks a lot.


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



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

Posted by GitBox <gi...@apache.org>.
wojustme removed a comment on pull request #2542:
URL: https://github.com/apache/calcite/pull/2542#issuecomment-927401596


   Close it because of invalid [issue-4801](https://issues.apache.org/jira/browse/CALCITE-4801).


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



[GitHub] [calcite] wojustme closed pull request #2542: [CALCITE-4801] SubstitutionVisitor support query pull up no-equal filter, when mv's aggregate rollup to query's aggregate(xurenhe)

Posted by GitBox <gi...@apache.org>.
wojustme closed pull request #2542:
URL: https://github.com/apache/calcite/pull/2542


   


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



[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)

Posted by GitBox <gi...@apache.org>.
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!
   Should not match in this case.




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



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

Posted by GitBox <gi...@apache.org>.
wojustme commented on pull request #2542:
URL: https://github.com/apache/calcite/pull/2542#issuecomment-927401702


   Close it because of invalid [issue-4801](https://issues.apache.org/jira/browse/CALCITE-4801).


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