huan233usc commented on code in PR #2651:
URL: https://github.com/apache/iceberg-rust/pull/2651#discussion_r3423627723


##########
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:
   This collects the entire stream before deleting. Since `delete_stream` is 
used by purge/cleanup paths, large tables can make this unbounded in memory. 
   
   Can we keep routing per prefix but flush bounded batches as we iterate, 
instead of materializing all paths first?



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

Reply via email to