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/10 01:39:39 UTC

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

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