szehon-ho commented on code in PR #15297:
URL: https://github.com/apache/iceberg/pull/15297#discussion_r2806306301
##########
spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java:
##########
@@ -113,7 +112,7 @@ public class SparkScanBuilder
CaseInsensitiveStringMap options) {
this.spark = spark;
this.table = table;
- this.schema = schema;
+ this.projection = schema;
Review Comment:
i like the rename
##########
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
Review Comment:
maybe 'new' and 'old' lack context, how about something like:
a function that returns the original ID unless it is in conflictingIds, in
which case returns the new ID it has been reassigned to.
--
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]