amogh-jahagirdar commented on code in PR #16957:
URL: https://github.com/apache/iceberg/pull/16957#discussion_r3825862668


##########
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:
   Okay I read through the thread in 
https://github.com/apache/iceberg/pull/16939 yeah the conclusion was we really 
should never be in this situation which I do agree with. Just didn't want to 
potentially break a bunch of people on read, but it's probably worth it in 
order to get them to fix up metadata



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