Hi all,

remove_orphan_files with a file_list_view filters the list with a raw
startsWith(location). For a location like s3://bucket/table, that also
matches s3://bucket/table-backup/..., so files in a sibling directory can
be treated as orphans and deleted (#16493). Russell called the filter
"worth fixing as a normal bug", and Ryan said it seems reasonable to fix it
in a separate PR.

#16498 matches on the location as a directory instead. This changes only
the file-list path, since directory listing is already bounded:
- entries under a sibling prefix such as table-backup are no longer in scope
- an entry equal to the location itself is no longer in scope

Anyone relying on a partial prefix, for example location =
s3://bucket/table to clean both table and table-backup, would need to run
the action once per directory. I don't expect that to be common, but it is
a behavior change, so Sung  asked to raise it here.

#18029 proposes the same check but keeps an entry equal to the location in
scope.

If there are no objections within a week, I'd like to go ahead with #16498
on Spark 4.2 and backport it to 3.5, 4.0 and 4.1 afterwards.

https://github.com/apache/iceberg/pull/16498
https://github.com/apache/iceberg/issues/16493

Thanks,
Vova

Reply via email to