jackye1995 commented on a change in pull request #2465:
URL: https://github.com/apache/iceberg/pull/2465#discussion_r620740478



##########
File path: api/src/main/java/org/apache/iceberg/UpdateSchema.java
##########
@@ -384,4 +386,24 @@ default UpdateSchema updateColumn(String name, 
Type.PrimitiveType newType, Strin
    *                                  with other additions, renames, or 
updates.
    */
   UpdateSchema unionByNameWith(Schema newSchema);
+
+  /**
+   * Set the identifier fields given a set of field names.
+   * See {@link Schema#identifierFieldIds()} to learn more about Iceberg 
identifier.
+   *
+   * @param names names of the columns to set as identifier fields
+   * @return this for method chaining
+   */
+  UpdateSchema setIdentifierFields(Set<String> names);

Review comment:
       `Set` was used to explicitly tell users that identifier fields need to 
be unique, instead of giving people an illusion that the update operation can 
still succeed with repeated value.
   
   Technically we can use `List`, `Iterable` or `Collection`. If we would like 
to make a broader use case for the API, I can document the behavior in javadoc.




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

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