RussellSpitzer commented on code in PR #16957:
URL: https://github.com/apache/iceberg/pull/16957#discussion_r3831104154


##########
core/src/main/java/org/apache/iceberg/DeleteFileIndex.java:
##########
@@ -211,10 +226,34 @@ private DeleteFile findDV(long seq, DataFile dataFile) {
           "DV data sequence number (%s) must be greater than or equal to data 
file sequence number (%s)",
           dv.dataSequenceNumber(),
           seq);
+      validatePartitionMatch(dv, dataFile);
     }
     return dv;
   }
 
+  private void validatePartitionMatch(DeleteFile deleteFile, DataFile 
dataFile) {
+    ValidationException.check(
+        deleteFile.specId() == dataFile.specId(),
+        "Mismatched partition specs (%s, %s) for delete file %s and data file 
%s:"
+            + " metadata is corrupted",
+        deleteFile.specId(),

Review Comment:
   So are you +1 or -1 @amogh-jahagirdar ? I think we already have some logic 
for failing this at commit time if we see it in existing DV's. I'm not sure we 
should allow folks to read if we wouldn't let them write on top of that state.



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