tanclary commented on code in PR #3677:
URL: https://github.com/apache/calcite/pull/3677#discussion_r1498354415
##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java:
##########
@@ -3262,11 +3262,21 @@ private static class CastImplementor extends
AbstractRexCallImplementor {
@Override Expression implementSafe(final RexToLixTranslator translator,
final RexCall call, final List<Expression> argValueList) {
- assert call.getOperands().size() == 1;
+ assert call.getOperands().size() <= 2;
final RelDataType sourceType = call.getOperands().get(0).getType();
- // Short-circuit if no cast is required
RexNode arg = call.getOperands().get(0);
+ ConstantExpression formatExpr;
+ if (call.getOperands().size() > 1) {
Review Comment:
In the future if there was another argument we may not want it to follow the
same logic, that's why I think equivalency is a better check. It feels
presumptuous to assume any operand count >1 should follow this.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]