rdblue commented on a change in pull request #4154:
URL: https://github.com/apache/iceberg/pull/4154#discussion_r812475776
##########
File path: api/src/main/java/org/apache/iceberg/types/TypeUtil.java
##########
@@ -273,7 +273,13 @@ public static Schema assignIncreasingFreshIds(Schema
schema) {
* @throws IllegalArgumentException if a field cannot be found (by name) in
the source schema
*/
public static Schema reassignIds(Schema schema, Schema idSourceSchema) {
- Types.StructType struct = visit(schema, new
ReassignIds(idSourceSchema)).asStructType();
+ Types.StructType struct = visit(schema, new ReassignIds(idSourceSchema,
null)).asStructType();
+ return new Schema(struct.fields(), refreshIdentifierFields(struct,
schema));
+ }
+
+ public static Schema reassignOrRefreshIds(Schema schema, Schema
idSourceSchema) {
+ AtomicInteger highest = new AtomicInteger(schema.highestFieldId());
Review comment:
Yes, that's exactly right. The assigned IDs are not the final IDs that
are assigned to the table. They are just temporary IDs that will be replaced by
`UpdateSchema` in `unionByNameWith`.
--
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]