ihuzenko 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_r358727873
##########
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:
Did you mean that ```String.format(...)``` will take more actions to combine
string and it's better to use simple concatenation here?
----------------------------------------------------------------
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