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/06/09 16:27:38 UTC

[GitHub] [calcite] cshuo opened a new pull request #2012: [CALCITE-4053] RexSimplify should not pass exprs containing non-const…

cshuo opened a new pull request #2012:
URL: https://github.com/apache/calcite/pull/2012


   … subExprs to RexExecutor
   
   Currently in RexSimplify#simplifyCast, if an expression is judged as a const expression but the outer CAST can not be removed, we pass the original expression to `RexExecutor` to reduce the expression which may leads to unexpected exception when the original expression contains `RexInputRef`.


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



[GitHub] [calcite] danny0405 closed pull request #2012: [CALCITE-4053] RexSimplify should not pass exprs containing non-const…

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


   


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



[GitHub] [calcite] danny0405 commented on a change in pull request #2012: [CALCITE-4053] RexSimplify should not pass exprs containing non-const…

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



##########
File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
##########
@@ -1950,7 +1950,8 @@ private RexNode simplifyCast(RexCall e) {
         break;
       }
       final List<RexNode> reducedValues = new ArrayList<>();
-      executor.reduce(rexBuilder, ImmutableList.of(e), reducedValues);
+      RexNode simplifiedExpr = rexBuilder.makeCast(e.getType(), operand);
+      executor.reduce(rexBuilder, ImmutableList.of(simplifiedExpr), reducedValues);
       return Objects.requireNonNull(

Review comment:
       Makes the `simplifiedExpr ` final.




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