Delete the root directory of an object if it is left empty after the object's deletion. #5269
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SC-53960
When deleting a TileDB object (array or a group) in the local file system, we delete its internal directories like
__schema
,__meta
or__fragments
, but the root directory itself is preserved. This PR changes this behavior to also delete the object's root directory, unless the object's deletion did not leave the directory empty, e.g. the user wrote some files there on their own.This matches the semantics of object storage where directories do not really exist, and naturally extends when deleting groups recursively.
TYPE: BREAKING_BEHAVIOR
DESC: Deleting an array or group will also delete its root directory if it was left empty.