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 2019/10/21 03:40:08 UTC

[GitHub] [calcite] danny0405 commented on a change in pull request #1507: [CALCITE-3414] In calcite-core, use RexToLixTranslator.convert for type conversion code generation uniformly

danny0405 commented on a change in pull request #1507: [CALCITE-3414] In calcite-core, use RexToLixTranslator.convert for type conversion code generation uniformly
URL: https://github.com/apache/calcite/pull/1507#discussion_r336827281
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java
 ##########
 @@ -1050,7 +1058,12 @@ public static Expression convert(Expression operand, Type fromType,
           return Expressions.box(una.expression, toBox);
         }
       }
-      return Expressions.box(operand, toBox);
+      if (fromType == toBox.primitiveClass) {
+        return Expressions.box(operand, toBox);
+      }
+      return Expressions.box(
 
 Review comment:
   Can we give more explain doc here, i understand this code id for the case `Integer.valueOf((int) longVal)`. But i still need to go through the code for a while why this code snippet is needed.

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