aokolnychyi commented on code in PR #11495:
URL: https://github.com/apache/iceberg/pull/11495#discussion_r1835613811


##########
core/src/main/java/org/apache/iceberg/MergingSnapshotProducer.java:
##########
@@ -271,6 +276,26 @@ private void add(PendingDeleteFile file) {
     }
   }
 
+  protected void validateNewDeleteFile(DeleteFile file) {
+    Preconditions.checkNotNull(file, "Invalid delete file: null");
+    Preconditions.checkArgument(formatVersion() >= 2, "Deletes are supported 
in V2 and above");
+    if (file.content() == FileContent.POSITION_DELETES) {
+      Preconditions.checkArgument(
+          formatVersion() != 2 || !ContentFileUtil.isDV(file),
+          "Must not use DVs for position deletes in V2: %s",
+          ContentFileUtil.dvDesc(file));
+      Preconditions.checkArgument(
+          formatVersion() == 2 || ContentFileUtil.isDV(file),

Review Comment:
   This method validates input from the user and ensures it is not possible to 
add a DV to a V2 table.



-- 
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-unsubscr...@iceberg.apache.org

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


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

Reply via email to