thinkharderdev opened a new issue, #67:
URL: https://github.com/apache/arrow-rs-object-store/issues/67

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   <!--
   A clear and concise description of what the problem is. Ex. I'm always 
frustrated when [...] 
   (This section helps Arrow developers understand the context and *why* for 
this feature, in addition to  the *what*)
   -->
   
   Currently the way to delete a "directory" through the `ObjectStore` 
interface is to call `list` with the directory path as prefix and then pipe 
that to `delete_stream`. 
   
   This is the correct way to do this for object storage since "directories" 
don't really exist and the path is just a prefix to individual objects. 
   
   But for actual filesystems directories are actual inodes themselves in the 
filesystem which should be cleaned up. 
   
   **Describe the solution you'd like**
   <!--
   A clear and concise description of what you want to happen.
   -->
   
   Add a new method to `ObjectStore`: `async fn delete_prefix(&self, prefix: 
Option<&Path>) -> Result<()>` 
   
   This default implementation for this method can just be calling 
`list(prefix)` and then piping that to `delete_stream` but in the case of 
`LocalFilesystem` (and potentially other implementations in the future) will be 
specialized to also delete directories 
   
   **Describe alternatives you've considered**
   <!--
   A clear and concise description of any alternative solutions or features 
you've considered.
   -->
   
   This could be handled inside `LocalFilesystem` during `delete_stream` but 
could become complicated. The implementation would have to:
   1. Track prefixes during the delete operation
   2. After delete determine if any of the prefixes are now empty
   3. Delete them
   
   **Additional context**
   <!--
   Add any other context or screenshots about the feature request here.
   -->
   


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

Reply via email to