nastra commented on code in PR #11419: URL: https://github.com/apache/iceberg/pull/11419#discussion_r1839935623
########## core/src/main/java/org/apache/iceberg/schema/UnionByNameVisitor.java: ########## @@ -180,6 +180,17 @@ private void updateColumn(Types.NestedField field, Types.NestedField existingFie } } + private boolean compatibleType(Type newType, Type existingType) { + if (existingType.isPrimitiveType()) { + // Primitive -> Wider Primitive + return newType.isPrimitiveType() + && TypeUtil.isPromotionAllowed(newType, existingType.asPrimitiveType()); Review Comment: just reading https://github.com/apache/iceberg/pull/11419#issuecomment-2471220679 now. I think it's a bit confusing with the method naming and how `isPromotionAllowed` is called to a reader of the code. I think I'd agree with @RussellSpitzer's comment about naming this more like `ignoreTypeChange` or something along those lines. Also the comments should probably indicate that `primitive type -> narrower primitive type` is effectively allowed -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org