fix: Automatic intermediate directory cleanup for file object store (#26480)

Removes empty intermediate directories when a key is removed from
local file system object storage, which matches cloud-based providers.
feat/add-retention-period-to-catalog_core
Stuart Carnie 2025-06-03 09:31:40 +10:00 committed by GitHub
parent 4c62b5273c
commit 494847b3e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 5 deletions

View File

@ -117,11 +117,14 @@ impl std::fmt::Display for LocalFileSystemWithSortedListOp {
impl LocalFileSystemWithSortedListOp {
fn new_with_prefix(prefix: impl AsRef<std::path::Path>) -> Result<Self, ParseError> {
Ok(Self {
inner: Arc::new(LocalFileSystem::new_with_prefix(prefix.as_ref()).context(
CreateLocalFileSystemSnafu {
path: prefix.as_ref().to_path_buf(),
},
)?),
inner: Arc::new(
LocalFileSystem::new_with_prefix(prefix.as_ref())
.context(CreateLocalFileSystemSnafu {
path: prefix.as_ref().to_path_buf(),
})?
// Clean up intermediate directories automatically.
.with_automatic_cleanup(true),
),
})
}
}