vlsi commented on a change in pull request #1610: [CALCITE-3525] RexSimplify: 
eliminate redundant rex calls in OR
URL: https://github.com/apache/calcite/pull/1610#discussion_r358714684
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexBuilder.java
 ##########
 @@ -1481,11 +1483,13 @@ public RexNode makeLiteral(Object value, RelDataType 
type,
         operands.add(e);
       }
       return new RexLiteral((Comparable) FlatLists.of(operands), type,
-          type.getSqlTypeName());
+          sqlTypeName);
     case ANY:
       return makeLiteral(value, guessType(value), allowCast);
     default:
-      throw Util.unexpected(type.getSqlTypeName());
+      throw new IllegalArgumentException(
+          String.format(Locale.ROOT,
+          "Cannot create literal for type '%s'", sqlTypeName));
 
 Review comment:
   Does it look like a `cpu-intensive` method on a hot path?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to