rdblue commented on a change in pull request #2465:
URL: https://github.com/apache/iceberg/pull/2465#discussion_r617122753
##########
File path: api/src/main/java/org/apache/iceberg/UpdateSchema.java
##########
@@ -384,4 +385,21 @@ 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 column names.
+ * <p>
+ * Identifier field is a similar concept as primary key in a relational
database system.
+ * A row should be unique based on the values of the identifier fields.
+ * However, unlike a primary key, Iceberg does not enforce the uniqueness of
a row based on this information.
+ * It is used for operations like upsert to define the default upsert key.
+ * <p>
+ * A column in the identifier fields must be of a primitive type.
+ * Each column set in this operation must exist in the current schema to
update,
+ * or is added as a part of this update.
+ *
+ * @param names names of the columns to set as identifier fields
+ * @return this for method chaining
+ */
+ UpdateSchema setIdentifierFields(Set<String> names);
Review comment:
We normally also add a `String...` variant for convenience so you don't
need to call `setIdentifierFields(ImmutableSet.of("a", "b"))`
--
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]