You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/09/29 23:08:05 UTC

[GitHub] [iceberg] aokolnychyi commented on a change in pull request #3199: Core: Validate concurrently added delete files in OvewriteFiles

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



##########
File path: core/src/main/java/org/apache/iceberg/BaseOverwriteFiles.java
##########
@@ -127,8 +147,29 @@ protected void validate(TableMetadata base) {
       }
     }
 
-    if (conflictDetectionFilter != null && base.currentSnapshot() != null) {
-      validateAddedDataFiles(base, startingSnapshotId, conflictDetectionFilter, caseSensitive);
+
+    if (validateNewDataFiles && base.currentSnapshot() != null) {
+      validateAddedDataFiles(base, startingSnapshotId, conflictDetectionFilter(), caseSensitive);
+    }
+
+    if (validateNewDeleteFiles && base.currentSnapshot() != null) {
+      if (rowFilter() != Expressions.alwaysFalse()) {
+        validateNoNewDeleteFiles(base, startingSnapshotId, conflictDetectionFilter(), caseSensitive);
+      } else if (deletedDataFiles.size() > 0) {

Review comment:
       I interpret it like this: call `validateNoNewDeletesForDataFiles` iff we replace only individual files as it more precise than checking if there are any deletes matching the filter. Call `validateNewDeleteFiles` in all other cases (like there are both individual files replaced and the overwrite filter is set). When calling `validateNewDeleteFiles`, we can use `rowFilter()` as the conflict detection iff we don't replace any individual files (i.e. `deletedDataFiles.isEmpty()`).
   
   In my view, `validateNoNewDeleteFiles` is a stronger guarantee than `validateNoNewDeletesForDataFiles`.




-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org