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/12/08 04:05:21 UTC

[GitHub] [calcite] danny0405 commented on a change in pull request #1609: [CALCITE-3520] Type cast from primitive to box is not correct

danny0405 commented on a change in pull request #1609: [CALCITE-3520] Type cast from primitive to box is not correct
URL: https://github.com/apache/calcite/pull/1609#discussion_r355158523
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java
 ##########
 @@ -400,8 +400,11 @@ public static Expression convert(Expression operand, Type fromType,
       if (operand instanceof UnaryExpression) {
         UnaryExpression una = (UnaryExpression) operand;
         if (una.nodeType == ExpressionType.Convert
-            || Primitive.of(una.getType()) == toBox) {
-          return Expressions.box(una.expression, toBox);
+            && Primitive.of(una.getType()) == toBox) {
+          Primitive origin = Primitive.of(una.expression.type);
 
 Review comment:
   Why change `||` to `&&`.

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