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 2020/02/13 08:31:37 UTC

[GitHub] [calcite] chunweilei opened a new pull request #1804: [CALCITE-3794] Return directly if there is no pulled up predicate

chunweilei opened a new pull request #1804: [CALCITE-3794] Return directly if there is no pulled up predicate
URL: https://github.com/apache/calcite/pull/1804
 
 
   Also some cosmetic changes.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] chunweilei commented on a change in pull request #1804: [CALCITE-3794] RexSimplify should return early if there is no pulled up predicate when simplifying using predicates

Posted by GitBox <gi...@apache.org>.
chunweilei commented on a change in pull request #1804: [CALCITE-3794] RexSimplify should return early if there is no pulled up predicate when simplifying using predicates
URL: https://github.com/apache/calcite/pull/1804#discussion_r379476518
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
 ##########
 @@ -1571,6 +1571,9 @@ RexNode simplifyAnd2ForUnknownAsFalse(List<RexNode> terms,
 
   private <C extends Comparable<C>> RexNode simplifyUsingPredicates(RexNode e,
       Class<C> clazz) {
+    if (predicates.pulledUpPredicates.isEmpty()) {
+      return e;
 
 Review comment:
   No, but it would bring some extra unnecessary overhead since all the following process still need to execute.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] chunweilei merged pull request #1804: [CALCITE-3794] Stop simplifying using predicates if the pulled up predicates is empty

Posted by GitBox <gi...@apache.org>.
chunweilei merged pull request #1804: [CALCITE-3794] Stop simplifying using predicates if the pulled up predicates is empty
URL: https://github.com/apache/calcite/pull/1804
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] chunweilei commented on a change in pull request #1804: [CALCITE-3794] RexSimplify should return early if there is no pulled up predicate when simplifying using predicates

Posted by GitBox <gi...@apache.org>.
chunweilei commented on a change in pull request #1804: [CALCITE-3794] RexSimplify should return early if there is no pulled up predicate when simplifying using predicates
URL: https://github.com/apache/calcite/pull/1804#discussion_r379296736
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
 ##########
 @@ -1978,7 +1980,7 @@ private static boolean canRollUp(TimeUnit outer, TimeUnit inner) {
       case MILLISECOND:
       case MICROSECOND:
         if (inner == TimeUnit.QUARTER) {
-          return outer == TimeUnit.YEAR || outer == TimeUnit.QUARTER;
+          return outer == TimeUnit.YEAR;
 
 Review comment:
   `outer == TimeUnit.QUARTER` is always false here.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] danny0405 commented on a change in pull request #1804: [CALCITE-3794] RexSimplify should return early if there is no pulled up predicate when simplifying using predicates

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #1804: [CALCITE-3794] RexSimplify should return early if there is no pulled up predicate when simplifying using predicates
URL: https://github.com/apache/calcite/pull/1804#discussion_r379464940
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
 ##########
 @@ -1571,6 +1571,9 @@ RexNode simplifyAnd2ForUnknownAsFalse(List<RexNode> terms,
 
   private <C extends Comparable<C>> RexNode simplifyUsingPredicates(RexNode e,
       Class<C> clazz) {
+    if (predicates.pulledUpPredicates.isEmpty()) {
+      return e;
 
 Review comment:
   What if we do not return early ? Is there any error occurs ?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services