thinkharderdev opened a new issue, #5591:
URL: https://github.com/apache/arrow-rs/issues/5591
**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*)
-->
Deleting a lot of objects from an `ObjectStore` can be expensive if you have
to do a separate API call for each object. In scenarios where you have to
delete a lot of objects in a batch (eg a compaction process) this can be very
annoying and resource intensive.
It would be helpful to add a `bulk_delete` method to `ObjectStore` that can
take advantage of underlying APIs that allow for bulk deletion (eg S3
`DeleteObjects` API).
The default implementation can just call `delete` on each path serially if
the underlying `ObjectStore` does not have an API for bulk deletion or we can
throw an unimplemented error instead.
**Describe the solution you'd like**
<!--
A clear and concise description of what you want to happen.
-->
pub struct BulkDeleteResult {
/// Count of objects successfully deleted
deleted: usize,
/// Errors for individual objects which could not be deleted for some
reason,
errors: Vec<(Path,Error)>,
}
Something like
```
pub trait ObjectStore {
async fn bulk_delete(&self, locations: &[Path]) ->
Result<BulkDeleteResult>;
}
```
**Describe alternatives you've considered**
<!--
A clear and concise description of any alternative solutions or features
you've considered.
-->
Do nothing
**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]