[CALCITE-2657] In RexShuttle, use "RexCall.clone" instead of "new RexCall" 
(Chunwei Lei)

Close apache/calcite#905


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/042fa6b7
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/042fa6b7
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/042fa6b7

Branch: refs/heads/master
Commit: 042fa6b7135fc8861816985253657dd685471f25
Parents: 7bc9f14
Author: chunwei.lcw <[email protected]>
Authored: Wed Nov 7 15:17:02 2018 +0800
Committer: Julian Hyde <[email protected]>
Committed: Thu Nov 8 10:00:37 2018 -0800

----------------------------------------------------------------------
 core/src/main/java/org/apache/calcite/rex/RexShuttle.java | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/042fa6b7/core/src/main/java/org/apache/calcite/rex/RexShuttle.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rex/RexShuttle.java 
b/core/src/main/java/org/apache/calcite/rex/RexShuttle.java
index d79dcbf..b1f1593 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexShuttle.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexShuttle.java
@@ -104,10 +104,7 @@ public class RexShuttle implements RexVisitor<RexNode> {
       // To do that, we would need to take a RexBuilder and
       // watch out for special operators like CAST and NEW where
       // the type is embedded in the original call.
-      return new RexCall(
-          call.getType(),
-          call.getOperator(),
-          clonedOperands);
+      return call.clone(call.getType(), clonedOperands);
     } else {
       return call;
     }

Reply via email to