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



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

Review comment:
       Yes, we mean a single-table transaction. Presto doesn't use `INSERT 
OVERWRITE` and recommends implementing an overwrite using a transaction with 
`DELETE FROM` and `INSERT INTO`. This allows Presto to validate the deleted 
files because they are actually overwritten, but appear in metadata to be 
deletes.




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