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


##########
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:
   I thought about this as well, but I think it would be tricky to solve this. 
Because OpenDal's operator is tied to a bucket, and if user passes in locations 
from multiple buckets then we will have to create operator for each of the 
incoming locations --- it's gonna be slow
   
   Also I'd say this is an acceptable limitation because most users will not 
have data spanned across several buckets



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