danielcweeks commented on code in PR #11495:
URL: https://github.com/apache/iceberg/pull/11495#discussion_r1837051720
##########
core/src/main/java/org/apache/iceberg/MergingSnapshotProducer.java:
##########
@@ -268,9 +274,32 @@ private void add(PendingDeleteFile file) {
if (deleteFiles.add(file)) {
addedFilesSummary.addedFile(spec, file);
hasNewDeleteFiles = true;
+ if (ContentFileUtil.isDV(file)) {
+ newDVRefs.add(file.referencedDataFile());
+ }
+ }
+ }
+
+ 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),
Review Comment:
This is a little more clear if we invert the check:
```suggestion
formatVersion() == 2 && ContentFileUtil.isDV(file),
```
--
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]