ebyhr commented on code in PR #12202: URL: https://github.com/apache/iceberg/pull/12202#discussion_r1950062665
########## core/src/main/java/org/apache/iceberg/SchemaUpdate.java: ########## @@ -391,13 +391,14 @@ private Integer findForMove(String name) { if (addedId != null) { return addedId; } + Types.NestedField field = findFieldFromUpdateFirst(name); + return field != null ? field.fieldId() : null; + } - Types.NestedField field = findField(name); - if (field != null) { - return field.fieldId(); - } - - return null; + private Types.NestedField findFieldFromUpdateFirst(String name) { + List<Types.NestedField> updatedFields = + updates.values().stream().filter(f -> f.name().equals(name)).collect(Collectors.toList()); Review Comment: nit: The size of `updatedFields` should be 0 or 1, right? How about verifying the size with `Preconditions.checkArgument` method? -- 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