alessandro-nori opened a new pull request, #17448:
URL: https://github.com/apache/iceberg/pull/17448

   ## Summary
   - In `DeleteOrphanFilesSparkAction.filteredCompareToFileList()`, when 
`compareToFileList` is used, files are filtered with `startsWith(location)`. If 
`location` doesn't end with `/`, this can also match sibling table paths (e.g. 
`/ns/my_table` matches `/ns/my_table_2`), incorrectly marking their files as 
orphans of the wrong table.
   - Normalize `location` to always end with `/` before filtering, mirroring 
the behavior of the default directory-listing path.
   - Scoped to Spark 4.1 (latest supported version per repo policy); older 
Spark versions can be addressed in a follow-up if this is approved.
   
   ## Motivation
   Prevents `deleteOrphanFiles` with a custom `compareToFileList` from deleting 
files belonging to a different table that merely shares a path prefix with the 
target table's location.


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