You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Benoit Hanotte (Jira)" <ji...@apache.org> on 2020/01/13 12:39:00 UTC

[jira] [Created] (FLINK-15574) DataType to LogicalType conversion issue

Benoit Hanotte created FLINK-15574:
--------------------------------------

             Summary: DataType to LogicalType conversion issue
                 Key: FLINK-15574
                 URL: https://issues.apache.org/jira/browse/FLINK-15574
             Project: Flink
          Issue Type: Improvement
          Components: Table SQL / Runtime
            Reporter: Benoit Hanotte


We seem to be encountering an issue with the conversion from DataType to LogicalType with the Blink planner:
{code}
org.apache.flink.table.api.ValidationException: Type LEGACY(BasicArrayTypeInfo<String>) of table field 'my_array' does not match with type BasicArrayTypeInfo<String> of the field 'my_array' of the TableSource return type.
{code}

It seems there exists 2 paths to do the conversion from DataType to LogicalType:

1. TypeConversions.fromLegacyInfoToDataType():
used for instance when calling TableSchema.fromTypeInformation().

2.  LogicalTypeDataTypeConverter.fromDataTypeToLogicalType() 
Deprecated but still used in TableSourceUtil and many other places.

These 2 code paths can return a different LogicalType for the same input, leading to issues when the LogicalTypes are compared to ensure they are compatible.  For instance, PlannerTypeUtils.isAssignable() returns false for a DataType created from BasicArrayTypeInfo (leading to the ValidationException above).





--
This message was sent by Atlassian Jira
(v8.3.4#803005)