danielcweeks commented on code in PR #14264:
URL: https://github.com/apache/iceberg/pull/14264#discussion_r2446335553
##########
core/src/main/java/org/apache/iceberg/BaseIncrementalChangelogScan.java:
##########
@@ -71,6 +82,14 @@ protected CloseableIterable<ChangelogScanTask> doPlanFiles(
.filter(manifest ->
changelogSnapshotIds.contains(manifest.snapshotId()))
.toSet();
+ // Build per-snapshot delete file indexes for added deletes
+ Map<Long, DeleteFileIndex> addedDeletesBySnapshot =
buildAddedDeleteIndexes(changelogSnapshots);
+
+ // Build delete file index for existing deletes (before the start
snapshot) if we have
+ // EQUALITY_DELETES files in the changelog range
+ DeleteFileIndex existingDeleteIndex =
+ buildExistingDeleteIndex(fromSnapshotIdExclusive,
addedDeletesBySnapshot);
Review Comment:
@pvary That's correct, but I think what we're trying to achieve is only
build the existing deletion index when required (not all the time). We
shouldn't have overlapping positional deletes, but an equality delete can
overlap (either an existing positional delete or a previous equality delete)
where we should not emit a row.
We also need to handle the case where there was a whole file deleted, which
also had some number of deletes applied to it (positional or equality) so we
omit the deleted rows.
@talatuyarer we need to add test cases for these scenarios, which we appear
to not properly cover since our tests are passing, but we're not covering all
these cases.
--
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]