aokolnychyi commented on a change in pull request #3069:
URL: https://github.com/apache/iceberg/pull/3069#discussion_r702099883



##########
File path: api/src/main/java/org/apache/iceberg/RowDelta.java
##########
@@ -109,6 +109,45 @@
    *
    * @param conflictDetectionFilter an expression on rows in the table
    * @return this for method chaining
+   * @deprecated this will be removed in 0.14.0;
+   *             use {@link #validateNoConflictingOperations(Expression)} 
instead
    */
-  RowDelta validateNoConflictingAppends(Expression conflictDetectionFilter);
+  @Deprecated
+  default RowDelta validateNoConflictingAppends(Expression 
conflictDetectionFilter) {
+    return validateNoConflictingOperations(conflictDetectionFilter);
+  }
+
+  /**
+   * Enables validation that no concurrent operation conflicts with this 
commit.
+   * <p>
+   * This method should be called when the table is queried to determine which 
records to delete/append.
+   * If a concurrent operation commits a new data or delete file after the 
table was queried and
+   * that file might contain either new records or relevant deletes matching 
the specified conflict
+   * detection filter, this operation will detect this during retries and fail.
+   * <p>
+   * Calling this method with a correct conflict detection filter is required 
to maintain
+   * serializable isolation for update/delete operations. Otherwise, the 
isolation level
+   * will be snapshot isolation.
+   * <p>
+   * Validation applies to operations happened since the snapshot passed to 
{@link #validateFromSnapshot(long)}.
+   *
+   * @param conflictDetectionFilter an expression on rows in the table
+   * @return this for method chaining
+   */
+  RowDelta validateNoConflictingOperations(Expression conflictDetectionFilter);
+
+  /**
+   * Enables validation that no new delete files have been added by a 
concurrent operations with
+   * deletes that may match the filter in {@link 
#validateNoConflictingOperations(Expression)}.
+   * <p>
+   * This method should be called when the table is queried to produce a row 
delta during
+   * UPDATE and MERGE operations. If a concurrent operation commits a new 
delete file,
+   * records that were read are no longer valid.
+   * <p>
+   * Calling this method isn't required during DELETE operations as it is ok 
when a particular
+   * record we are trying to delete was deleted concurrently.
+   *
+   * @return this for method chaining
+   */
+  RowDelta validateNoConflictingDeleteFiles();

Review comment:
       The behavior in `RowDelta` is slightly different compared to 
`OverwriteFiles`. If we are doing `DELETE`, it should be fine if there is 
another delete file added concurrently. It is just `UPDATE` and `MERGE` we have 
to validate.




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