szehon-ho commented on code in PR #15297:
URL: https://github.com/apache/iceberg/pull/15297#discussion_r2806278278
##########
api/src/main/java/org/apache/iceberg/types/TypeUtil.java:
##########
@@ -601,6 +601,52 @@ public interface GetID {
int get(int oldId);
}
+ /**
+ * Creates a function that reassigns specified field IDs.
+ *
+ * <p>This is useful for merging schemas where some field IDs in one schema
might conflict with
+ * IDs already in use by another schema. The function will reassign the
provided IDs to new unused
+ * IDs, while preserving other IDs.
+ *
+ * @param conflictingIds the set of conflicting field IDs that should be
reassigned
+ * @param usedIds the set of field IDs that are already in use and cannot be
reused
+ * @return a function that maps old IDs to new IDs while resolving conflicts
+ */
+ public static GetID reassignConflictingIds(Set<Integer> conflictingIds,
Set<Integer> usedIds) {
Review Comment:
i think 'conflictingIds' and 'usedIds' is confusing together.
How about 'conflictingIds' and 'allIds'. Usually conflictingIds is a subset
of allIds?
--
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]