JingsongLi commented on a change in pull request #10403: [FLINK-14645][table]
Support to keep nullability and precision when converting DataTypes to
properties
URL: https://github.com/apache/flink/pull/10403#discussion_r354243868
##########
File path:
flink-table/flink-table-common/src/main/java/org/apache/flink/table/sources/TableSourceValidation.java
##########
@@ -181,6 +182,16 @@ private static void validateLogicalTypeEqualsPhysical(
TableSource<?> tableSource) {
ResolvedField resolvedField = resolveField(fieldName,
tableSource);
if (!resolvedField.getType().equals(logicalType)) {
+
+ if (resolvedField.getType().getLogicalType() instanceof
LegacyTypeInformationType &&
+ logicalType.getLogicalType().getTypeRoot() ==
LogicalTypeRoot.DECIMAL &&
+ logicalType.getLogicalType().getTypeRoot() ==
resolvedField.getType().getLogicalType().getTypeRoot() &&
+ logicalType.getConversionClass() ==
resolvedField.getType().getConversionClass()) {
Review comment:
I mean above `if (!resolvedField.getType().equals(logicalType))` should be
`if
(!resolvedField.getType().getLogicalType().equals(logicalType.getLogicalType()))`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services