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



##########
File path: api/src/main/java/org/apache/iceberg/RowDelta.java
##########
@@ -44,4 +46,61 @@
    * @return this for method chaining
    */
   RowDelta addDeletes(DeleteFile deletes);
+
+  /**
+   * Set the snapshot ID used in any reads for this operation.
+   * <p>
+   * Validations will check changes after this snapshot ID.
+   *
+   * @param snapshotId a snapshot ID
+   * @return this for method chaining
+   */
+  RowDelta validateFromSnapshot(long snapshotId);
+
+  /**
+   * Add data file paths that must not be removed by conflicting commits for 
this RowDelta to succeed.
+   * <p>
+   * If any path has been removed by a conflicting commit in the table since 
the snapshot passed to
+   * {@link #validateFromSnapshot(long)}, the operation will fail with a
+   * {@link org.apache.iceberg.exceptions.ValidationException}.
+   * <p>
+   * By default, this validation checks only rewrite and overwrite commits. To 
apply validation to delete commits, call
+   * {@link #validateDeletedFiles()}.
+   *
+   * @param referencedFiles file paths that are referenced by a position 
delete file
+   * @return this for method chaining
+   */
+  RowDelta validateDataFilesExist(Iterable<? extends CharSequence> 
referencedFiles);
+
+  /**
+   * Enable validation that referenced data files passed to {@link 
#validateDataFilesExist(Iterable)} have not been
+   * removed by a delete operation.
+   * <p>
+   * If a data file has a row deleted using a position delete file, rewriting 
or overwriting the data file concurrently
+   * would un-delete the row. Deleting the data file is normally allowed, but 
a delete may be part of a transaction
+   * that reads and re-appends a row. This method is used to validate deletes 
for the transaction case.
+   *
+   * @return this for method chaining
+   */
+  RowDelta validateDeletedFiles();
+
+  /**
+   * Enables validation that files added concurrently do not conflict with 
this commit's operation.
+   * <p>
+   * This method should be called when the table is queried to determine which 
files to delete/append.
+   * If a concurrent operation commits a new file after the data was read and 
that file might
+   * contain rows matching the specified conflict detection filter, the 
overwrite 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 eager update/delete operations. Otherwise, the 
isolation level

Review comment:
       Yes.




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