williamhyun commented on code in PR #17497:
URL: https://github.com/apache/iceberg/pull/17497#discussion_r3731240857


##########
core/src/main/java/org/apache/iceberg/rest/TableScanResponseParser.java:
##########
@@ -119,7 +121,12 @@ public static void serializeScanTasks(
         Set<Integer> deleteFileReferences = Sets.newHashSet();
         if (deleteFiles != null) {
           for (DeleteFile taskDelete : fileScanTask.deletes()) {
-            
deleteFileReferences.add(deleteFilePathToIndex.get(taskDelete.location()));
+            Integer index = 
deleteFileToIndex.get(DeleteFileWrapper.wrap(taskDelete));
+            Preconditions.checkArgument(
+                index != null,
+                "Cannot serialize scan task with delete file missing from 
delete files: %s",

Review Comment:
   +1, 
   Added 
`TestTableScanResponseParser#cannotSerializeScanTaskWithDeleteFileMissingFromDeleteFiles`.
   
   This branch isn't reachable via the response parsers. The only builder path 
to a mismatch is the deprecated `withDeleteFiles` (aimed for removal in 
1.12.0), so the test calls `serializeScanTasks` directly, which fits best in 
its own class.



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