feat(io): Add delete_stream to Storage trait#2216
Open
CTTY wants to merge 6 commits intoapache:mainfrom
Open
Conversation
blackmwk
reviewed
Mar 6, 2026
CTTY
commented
Mar 6, 2026
| } | ||
| } | ||
| } | ||
|
|
Collaborator
Author
There was a problem hiding this comment.
I didn't add this for gcs because fake-gcs-server doesn't support batch delete
Contributor
There was a problem hiding this comment.
Sorry, I don't get your point.
blackmwk
reviewed
Mar 9, 2026
| /// # Arguments | ||
| /// | ||
| /// * paths: A stream of absolute paths starting with the scheme string used to construct [`FileIO`]. | ||
| pub async fn delete_stream(&self, paths: BoxStream<'static, String>) -> Result<()> { |
Contributor
There was a problem hiding this comment.
nit: We could make this api more general as following:
fn delete_stream(&self, paths: impl Stream<Item=String>) |
|
||
| // Use relativize_path for remaining paths to avoid rebuilding the operator each time. | ||
| while let Some(path) = paths.next().await { | ||
| let relative_path = self.relativize_path(&path)?; |
Contributor
There was a problem hiding this comment.
I see some problems with this approach, what if we are deleting things as following:
s3://bucket1/a.txt
s3://bucketb/b.txt
| } | ||
| } | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
Sorry, I don't get your point.
| } | ||
|
|
||
| #[tokio::test] | ||
| async fn test_file_io_s3_delete_stream() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
What changes are included in this PR?
delete_streamtoStoragetrait to support batch deletedelete_streaminFileIOas wellAre these changes tested?
Added uts
Addded integtests for opendal