aokolnychyi commented on code in PR #15268:
URL: https://github.com/apache/iceberg/pull/15268#discussion_r2785369701
##########
api/src/main/java/org/apache/iceberg/Schema.java:
##########
@@ -629,4 +631,30 @@ public static void checkCompatibility(Schema schema, int
formatVersion) {
formatVersion, Joiner.on("\n- ").join(problems.values())));
}
}
+
+ // indexes all fields from schemas, preferring field definitions from higher
schema IDs
+ public static Map<Integer, NestedField> indexFields(Collection<Schema>
schemas) {
+ if (schemas.size() == 1) {
+ Schema schema = Iterables.getOnlyElement(schemas);
+ return schema.lazyIdToField();
+ }
+
+ Map<Integer, NestedField> fields = Maps.newHashMap();
Review Comment:
I thought about that but decided it wasn't worth the complexity. Also, I am
using `putAll` so the map construction should be fairly efficient. What do you
think?
--
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]