szehon-ho commented on a change in pull request #2925:
URL: https://github.com/apache/iceberg/pull/2925#discussion_r809396115



##########
File path: core/src/main/java/org/apache/iceberg/BaseReplacePartitions.java
##########
@@ -53,6 +62,38 @@ public ReplacePartitions validateAppendOnly() {
     return this;
   }
 
+  @Override
+  public ReplacePartitions validateFromSnapshot(long newStartingSnapshotId) {
+    this.startingSnapshotId = newStartingSnapshotId;
+    return this;
+  }
+
+  @Override
+  public ReplacePartitions validateNoConflictingDeletes() {
+    this.validateNewDeleteFiles = true;
+    return this;
+  }
+
+  @Override
+  public ReplacePartitions validateNoConflictingData() {
+    this.validateNewDataFiles = true;
+    return this;
+  }
+
+  @Override
+  public void validate(TableMetadata currentMetadata) {
+    if (validateNewDataFiles) {
+      if (dataSpec().isUnpartitioned()) {
+        validateAddedDataFiles(currentMetadata, startingSnapshotId, 
Expressions.alwaysTrue());
+      } else {
+        validateAddedDataFiles(currentMetadata, startingSnapshotId, 
replacedPartitions);
+      }
+    }
+    if (validateNewDeleteFiles) {

Review comment:
       Good catch, added the check and test of concurrently deleted data files 
as discussed.




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