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)