julianhyde commented on code in PR #3677:
URL: https://github.com/apache/calcite/pull/3677#discussion_r1498350848


##########
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 situations like this, I use `> 1`. It is more future-proof, and asks for 
only what it needs.



-- 
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: commits-unsubscr...@calcite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to