stayrascal commented on code in PR #324:
URL: 
https://github.com/apache/arrow-rs-object-store/pull/324#discussion_r2041116720


##########
src/lib.rs:
##########
@@ -745,7 +767,29 @@ pub trait ObjectStore: std::fmt::Display + Send + Sync + 
Debug + 'static {
     ///
     /// Prefixes are evaluated on a path segment basis, i.e. `foo/bar` is a 
prefix of `foo/bar/x` but not of
     /// `foo/bar_baz/x`. List is not recursive, i.e. `foo/bar/more/x` will not 
be included.
-    async fn list_with_delimiter(&self, prefix: Option<&Path>) -> 
Result<ListResult>;
+    async fn list_with_delimiter(&self, prefix: Option<&Path>) -> 
Result<ListResult> {
+        let mut stream = self.list_opts(
+            prefix,
+            ListOpts {
+                delimiter: true,
+                ..ListOpts::default()
+            },
+        );
+
+        let mut common_prefixes = BTreeSet::new();
+        let mut objects = Vec::new();
+
+        while let Some(result) = stream.next().await {
+            let response = result?;
+            common_prefixes.extend(response.common_prefixes.into_iter());

Review Comment:
   it could be, but the BTreeSet should deduplicate the common_prefixes.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to