From df985871250fdc988cb5a6cad047708e3b2f60cf Mon Sep 17 00:00:00 2001 From: Shingo OKAWA Date: Wed, 31 May 2023 00:43:39 +0900 Subject: [PATCH] feat: add list_with_offset to DeltaObjectStore (#1410) # Description Adds the `list_with_offset` delegation method to `DeltaObjectStore`. # Related Issue(s) - closes #1252 # Documentation https://github.com/apache/arrow-rs/issues/3970 Signed-off-by: Shingo OKAWA --- rust/src/storage/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rust/src/storage/mod.rs b/rust/src/storage/mod.rs index 8cd744a99e..422ecedadf 100644 --- a/rust/src/storage/mod.rs +++ b/rust/src/storage/mod.rs @@ -236,6 +236,18 @@ impl ObjectStore for DeltaObjectStore { self.storage.list(prefix).await } + /// List all the objects with the given prefix and a location greater than `offset` + /// + /// Some stores, such as S3 and GCS, may be able to push `offset` down to reduce + /// the number of network requests required + async fn list_with_offset( + &self, + prefix: Option<&Path>, + offset: &Path, + ) -> ObjectStoreResult>> { + self.storage.list_with_offset(prefix, offset).await + } + /// List objects with the given prefix and an implementation specific /// delimiter. Returns common prefixes (directories) in addition to object /// metadata.