raminqaf commented on code in PR #28733:
URL: https://github.com/apache/flink/pull/28733#discussion_r3574020614
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeCasts.java:
##########
@@ -726,6 +730,31 @@ private static boolean supportsConstructedCasting(
return false;
}
+ private static boolean supportsVariantToScalarCast(LogicalType targetType)
{
+ switch (targetType.getTypeRoot()) {
+ case BOOLEAN:
+ case TINYINT:
+ case SMALLINT:
+ case INTEGER:
+ case BIGINT:
+ case FLOAT:
+ case DOUBLE:
+ case DECIMAL:
+ case BINARY:
+ case VARBINARY:
+ case DATE:
+ case TIMESTAMP_WITHOUT_TIME_ZONE:
+ case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
+ return true;
+ default:
+ // TIME has no counterpart in the Variant type model.
CHARACTER_STRING is handled by
Review Comment:
Even though this is a good idea and helpful for the user. Implementing it is
a bit messy. Still I kept the changes for you to review. Since it adds lots of
nose in the method. But let me know what you think. See
`getUnsupportedCastHint` and `CastInputTypeStrategy`.
--
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]