plusplusjiajia commented on code in PR #2651:
URL: https://github.com/apache/iceberg-rust/pull/2651#discussion_r3426917968
##########
crates/iceberg/src/io/file_io.rs:
##########
@@ -150,7 +173,29 @@ impl FileIO {
&self,
paths: impl Stream<Item = String> + Send + 'static,
) -> Result<()> {
- self.get_storage()?.delete_stream(paths.boxed()).await
+ // No per-prefix storages: delete the whole batch on the default
storage.
+ if self.prefixed.is_empty() {
+ return self.get_storage("")?.delete_stream(paths.boxed()).await;
+ }
+
+ // Otherwise group paths by routed storage, then batch-delete each
group.
+ let mut groups: HashMap<String, Vec<String>> = HashMap::new();
Review Comment:
@huan233usc Good catch, thanks. Reworked to flush bounded per-prefix batches
as we iterate instead of materializing everything — memory's now bounded
regardless of stream size, mirroring Java's S3FileIO.deleteFiles. Added a test
crossing the batch boundary.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]