blackmwk commented on code in PR #2216:
URL: https://github.com/apache/iceberg-rust/pull/2216#discussion_r2908645093


##########
crates/storage/opendal/src/lib.rs:
##########
@@ -400,6 +497,33 @@ impl Storage for OpenDalStorage {
         Ok(op.remove_all(&path).await.map_err(from_opendal_error)?)
     }
 
+    async fn delete_stream(&self, mut paths: BoxStream<'static, String>) -> 
Result<()> {
+        // Get the first path to create the operator
+        let Some(first_path) = paths.next().await else {
+            return Ok(());
+        };
+
+        let (op, first_relative) = self.create_operator(&first_path)?;
+
+        let mut deleter = op.deleter().await.map_err(from_opendal_error)?;
+        deleter
+            .delete(first_relative)
+            .await
+            .map_err(from_opendal_error)?;
+
+        // 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)?;

Review Comment:
   We don't need to create operator for each location, we just need to create 
operator for each bucket.



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