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



##########
File path: api/src/main/java/org/apache/iceberg/UpdateSchema.java
##########
@@ -384,4 +384,25 @@ default UpdateSchema updateColumn(String name, 
Type.PrimitiveType newType, Strin
    *                                  with other additions, renames, or 
updates.
    */
   UpdateSchema unionByNameWith(Schema newSchema);
+
+  /**
+   * Add a new row identifier given the column name.
+   * <p>
+   * The column must be a required field of a primitive type.
+   * It must exist in the current schema to update, or is added as a part of 
this update.
+   *
+   * @param columnName name of the column to add as a row identifier
+   * @return this for method chaining
+   */
+  UpdateSchema addRowIdentifier(String columnName);

Review comment:
       @jackye1995, I don't think that the add/remove example you gave is 
idempotent because of the check `identifierFieldNames.contains(name)` that will 
result in an error: "Cannot remove column from identifier fields account_id 
because it is not an identifier field". @openinx gives a good example of why 
it's awkward to make users fall back to `remove`. And it is easy to make `set` 
work internally because you just clear the field ID set before calling `add` in 
a loop.




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