danielcweeks commented on code in PR #11495:
URL: https://github.com/apache/iceberg/pull/11495#discussion_r1837127586
##########
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:
Yeah, you're right. I feel like these are hard to read because of the way
the checks stack on each other.
--
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]