You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/04/12 08:08:16 UTC

[GitHub] [flink] matriv commented on a diff in pull request #19426: [FLINK-25928][table-planner] Throw validation error early for CAST

matriv commented on code in PR #19426:
URL: https://github.com/apache/flink/pull/19426#discussion_r848115742


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeCasts.java:
##########
@@ -589,6 +591,37 @@ protected Boolean defaultMethod(LogicalType targetType) {
         }
     }
 
+    /**
+     * Check if the source/target pair is not allowed and throw a {@link ValidationException} with a
+     * useful error message.
+     */

Review Comment:
   We need a call to some method that does this validation before:
   ```return SqlTypeUtil.canCastFrom(toType, fromType, true);
   ```
   So we have to do it in a separate method, I don't see another way, but the `supportsExplicitCast` will call it as it is in this PR already, so for our Flink stack, there is no need for a separate method call.



-- 
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: issues-unsubscribe@flink.apache.org

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