paraseba opened a new issue, #6375:
URL: https://github.com/apache/arrow-rs/issues/6375
**Describe the bug**
The `LocalFileSystem` `list` implementation returns objects in what looks
like arbitrary order.
S3's `ListObjectsV2` returns objects in lexicographical order of their keys:
> General purpose bucket - For general purpose buckets, ListObjectsV2
returns objects in lexicographical order based on their key names.
**To Reproduce**
The following code fails the assertion:
```rust
use futures::TryStreamExt;
use object_store::{local::LocalFileSystem, ObjectStore, PutPayload};
use std::assert_eq;
use std::fs::create_dir_all;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let dir = "/tmp/reproducer";
create_dir_all(dir)?;
let store = LocalFileSystem::new_with_prefix(dir)?;
for i in 0..=9 {
store.put(&(i.to_string()).into(),
PutPayload::from_static(b"42")).await?;
}
let actual = store
.list(None)
.map_ok(|om| om.location.to_string())
.try_collect::<Vec<_>>()
.await?;
let expected = (0..=9).map(|s| s.to_string()).collect::<Vec<_>>();
assert_eq!(actual, expected);
Ok(())
}
```
**Expected behavior**
`LocalFileSystem` should mimic what `ListObjectsV2` does, returning objects
in lexicographical order of their keys.
**Additional context**
`InMemory` doesn't fail this test.
--
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]