sqd commented on code in PR #17024:
URL: https://github.com/apache/iceberg/pull/17024#discussion_r3561830871


##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/EvolveSchemaVisitor.java:
##########
@@ -211,8 +211,15 @@ private void updateColumn(Types.NestedField existingField, 
Types.NestedField tar
     String existingColumnName = 
this.existingSchema.findColumnName(existingField.fieldId());
 
     boolean needsOptionalUpdate = targetField.isOptional() && 
existingField.isRequired();
+    boolean handledByDataConversion =
+        existingField.type().isPrimitiveType()
+            && targetField.type().isPrimitiveType()
+            && CompareSchemasVisitor.isDataConversionPossible(
+                targetField.type().asPrimitiveType(), 
existingField.type().asPrimitiveType());
     boolean needsTypeUpdate =
-        targetField.type().isPrimitiveType() && 
!targetField.type().equals(existingField.type());
+        targetField.type().isPrimitiveType()
+            && !targetField.type().equals(existingField.type())
+            && !handledByDataConversion;

Review Comment:
   I am not sure I understand. For example, if both types are structs, then 
data conversion is not possible. But we shouldn't fail schema update in this 
case, because that is handled by the visitor recursing into the struct, not by 
data conversion.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to