rdblue commented on a change in pull request #2465:
URL: https://github.com/apache/iceberg/pull/2465#discussion_r612816486
##########
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:
Here also, I don't think that "row identifier" is the right noun. I'd
prefer `addIdentifierField` and `removeIdentifierField`. I'd use `remove`
rather than `delete` because it is more clear that the field itself will not be
deleted, just removed from the identifier. I also think that we should make
sure that behavior (removing from the identifier field list, not dropping the
column) is clear in the Javadoc.
What about also adding `setIdentifierFields`? I think that a bulk
set/replace operation fits more cleanly with the use case where users are
setting the identifier for the first time or replacing it. I think that this
will tend to be idempotent: set the identifier fields to `account_id` and
`profile_id`.
--
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]