karuppayya commented on code in PR #5409:
URL: https://github.com/apache/iceberg/pull/5409#discussion_r937117627


##########
api/src/main/java/org/apache/iceberg/types/TypeUtil.java:
##########
@@ -288,13 +288,41 @@ public static Schema reassignIds(Schema schema, Schema 
idSourceSchema) {
     return new Schema(struct.fields(), refreshIdentifierFields(struct, 
schema));
   }
 
+  /**
+   * Reassigns ids in a schema from another schema.
+   *
+   * <p>Ids are determined by field names. If a field in the schema cannot be 
found in the source
+   * schema, this will throw IllegalArgumentException.
+   *
+   * <p>This will not alter a schema's structure, nullability, or types.
+   *
+   * @param schema the schema to have ids reassigned
+   * @param idSourceSchema the schema from which field ids will be used
+   * @return an structurally identical schema with field ids matching the 
source schema
+   * @throws IllegalArgumentException if a field cannot be found (by name) in 
the source schema
+   */
+  public static Schema reassignIds(Schema schema, Schema idSourceSchema, 
boolean caseSensitive) {

Review Comment:
   done



##########
core/src/main/java/org/apache/iceberg/schema/UnionByNameVisitor.java:
##########
@@ -57,6 +63,25 @@ public static void visit(UpdateSchema api, Schema 
existingSchema, Schema newSche
         new PartnerIdByNameAccessors(existingSchema));
   }
 
+  /**
+   * Adds changes needed to produce a union of two schemas to an {@link 
UpdateSchema} operation.
+   *
+   * <p>Changes are accumulated to evolve the existingSchema into a union with 
newSchema.
+   *
+   * @param api an UpdateSchema for adding changes
+   * @param existingSchema an existing schema
+   * @param caseSensitive when false, the case of schema's fields are ignored
+   * @param newSchema a new schema to compare with the existing
+   */
+  public static void visit(

Review Comment:
   done



-- 
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]

Reply via email to