snuyanzin commented on code in PR #28152:
URL: https://github.com/apache/flink/pull/28152#discussion_r3235076255


##########
flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/fun/SqlCastFunction.java:
##########
@@ -226,9 +229,17 @@ public SqlOperandCountRange getOperandCountRange() {
     public boolean checkOperandTypes(SqlCallBinding callBinding, boolean 
throwOnFailure) {
         final SqlNode left = callBinding.operand(0);
         final SqlNode right = callBinding.operand(1);
+        final SqlLiteral format =
+                callBinding.getOperandCount() > 2
+                        ? (SqlLiteral) callBinding.operand(2)
+                        : SqlLiteral.createNull(SqlParserPos.ZERO);
+
         if (SqlUtil.isNullLiteral(left, false) || left instanceof 
SqlDynamicParam) {
             return true;
         }
+        if (!SqlUtil.isNull(format)) {
+            throw new ValidationException("CAST with FORMAT is not yet 
supported");
+        }

Review Comment:
   for now fail here in case of `CAST` with `FORMAT`



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

Reply via email to