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. 



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