tustvold commented on code in PR #7019:
URL: https://github.com/apache/arrow-rs/pull/7019#discussion_r1946459525
##########
object_store/src/local.rs:
##########
@@ -1401,6 +1432,66 @@ mod tests {
);
}
+ #[tokio::test]
+ async fn test_path_with_offset() {
+ let root = TempDir::new().unwrap();
+ let integration =
LocalFileSystem::new_with_prefix(root.path()).unwrap();
+
+ let root_path = root.path();
+ for i in 0..5 {
+ let filename = format!("test{}.parquet", i);
+ let file = root_path.join(filename);
+ std::fs::write(file, "test").unwrap();
+ }
+ let filter_str = "test";
+ let filter = String::from(filter_str);
+ let offset_str = filter + "1";
+ let offset = Path::from(offset_str.clone());
+
+ // Use list_with_offset to retrieve files
+ let res = integration.list_with_offset(None, &offset);
+ let offset_paths: Vec<_> = res.map_ok(|x|
x.location).try_collect().await.unwrap();
+ let mut offset_files: Vec<_> = offset_paths
+ .iter()
+ .map(|x| String::from(x.filename().unwrap()))
+ .collect();
+
+ // Check result with direct filesystem read
Review Comment:
I've not had time to review this in detail but a couple of points that may
or may not be relevant:
* We do not guarantee the order of list results -
https://docs.rs/object_store/latest/object_store/trait.ObjectStore.html#tymethod.list
* Filesystems on many systems do not yield a consistent ordering - it is
normally stable in the absence of mutation, but this isn't a strict guarantee
Or to phrase it either way, we shouldn't need to sort, nor should we rely on
data being sorted
--
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]