zjuwangg commented on a change in pull request #11848:
URL: https://github.com/apache/flink/pull/11848#discussion_r413809329



##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TypeMappingUtils.java
##########
@@ -158,19 +158,33 @@ public static void checkPhysicalLogicalTypeCompatible(
                        String physicalFieldName,
                        String logicalFieldName,
                        boolean isSource) {
-               checkIfCompatible(
-                       physicalFieldType,
-                       logicalFieldType,
-                       (cause) -> new ValidationException(
-                               String.format(
-                                       "Type %s of table field '%s' does not 
match with " +
-                                               "the physical type %s of the 
'%s' field of the %s.",
+               if (isSource) {
+                       checkIfCompatible(
+                                       physicalFieldType,
+                                       logicalFieldType,
+                                       (cause) -> new ValidationException(
+                                                               
String.format("Type %s of table field '%s' does not match with " +
+                                                                       "the 
physical type %s of the '%s' field of the %s.",
+                                                                               
logicalFieldType,
+                                                                               
logicalFieldName,
+                                                                               
physicalFieldType,
+                                                                               
physicalFieldName,
+                                                                               
"TableSource return type"),

Review comment:
       ok




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to