You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "guykhazma (via GitHub)" <gi...@apache.org> on 2025/05/06 18:08:47 UTC

Re: [PR] Support changelog scan for table with delete files [iceberg]

guykhazma commented on code in PR #10935:
URL: https://github.com/apache/iceberg/pull/10935#discussion_r2076010462


##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/ChangelogRowReader.java:
##########
@@ -170,4 +240,10 @@ private static Stream<ContentFile<?>> addedRowsScanTaskFiles(AddedRowsScanTask t
     List<DeleteFile> deletes = task.deletes();
     return Stream.concat(Stream.of(file), deletes.stream());
   }
+
+  private static Stream<ContentFile<?>> deletedRowsScanTaskFiles(DeletedRowsScanTask task) {
+    DataFile file = task.file();
+    List<DeleteFile> deletes = task.addedDeletes();

Review Comment:
   Shouldn't it also pick up the existing deletes?
   Something like:
   ```
   List<DeleteFile> existingDeletes = task.existingDeletes();
       List<DeleteFile> addedDeletes = task.addedDeletes();
       List<DeleteFile> deletes =
           ImmutableList.<DeleteFile>builder().addAll(existingDeletes).addAll(addedDeletes).build();
   ```
   
   without this I noticed that it can lead to null pointer exceptions when there as an overwrite snapshot which has existing deletes in it.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org