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

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   
   Right now the `ObjectStore::delete_stream` method requires the input stream 
to have a lifetime `'a`. This restriction makes it more challenging for 
implementers. For example, in my project, I have a `ObjectStore` 
[wrapper](https://github.com/lakehq/sail/blob/5b9f0e500053c036ae3b784bedb15e9ec5eb57d9/crates/sail-object-store/src/layers/runtime.rs#L182-L185)
 that needs to spawn tasks for the operation, but since the input is `'a`, I 
cannot move the input to the future due to Rust's lifetime checker.
   
   It seems `delete_stream` is the only method that requires the `'a` lifetime. 
Other methods have been changed to use `'static` streams 
(<https://github.com/apache/arrow-rs/pull/6619>) already, so this may be a 
leftover due to historical reasons.
   
   **Describe the solution you'd like**
   
   I'd imagine the `delete_stream` method to be changed to the following.
   
   ```rust
       fn delete_stream(
           &self,
           locations: BoxStream<'static, Result<Path>>,
       ) -> BoxStream<'static, Result<Path>> {
   ````
   
   This is a breaking change on the interface, so all the implementations need 
to be adjusted accordingly. Fortunately, the method won't become harder to 
implement since this is a restriction on the input so it refines the problem 
space for the implementer.
   
   For users, this breaking change won't be too disruptive either, since the 
typical use case is to get the stream from `list` or `list_with_offset` (where 
the returned stream is of `'static` lifetime already), and then pass the stream 
to `delete_stream`.
   
   Since this would be a breaking change, I wonder if this could be considered 
for the 0.13 release 
(<https://github.com/apache/arrow-rs-object-store/issues/367>).
   
   **Describe alternatives you've considered**
   
   N/A
   
   **Additional context**
   
   There was a more general discussion on this topic: 
<https://github.com/apache/arrow-rs/issues/6587>


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