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



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

Review comment:
       Takes a bit of time to understand this if - else, especially as 
conflictDetectionFilter() itself returns conditionally.  Wonder if it can be 
simplified any way. 
   
   Tracing through the many cases,I was wondering some cases, eg:
   
   If (rowFilter != false && !deletedDataFiles.isEmpty && 
conflictDetectionFilter == true), seems we will call validateNoNewDeleteFiles 
with conflictDetectionFilter, is it intended?




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