-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Rust] ObjectStore::read_dir method #911
Conversation
Will add cloud storage tests into integration tests. |
@@ -176,6 +176,20 @@ impl ObjectStore { | |||
ObjectWriter::new(self, path).await | |||
} | |||
|
|||
/// Read a directory (start from base directory) and returns all sub-paths in the directory. | |||
pub async fn read_dir(&self, dir_path: impl Into<Path>) -> Result<Vec<String>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return Result<Vec<Path>>
instead for downstream processing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will fix it.
rust/src/io/object_store.rs
Outdated
.iter() | ||
.map(|cp| cp.filename().map(|s| s.to_string()).unwrap_or_default()) | ||
.chain(output.objects.iter().map(|o| o.location.to_string())) | ||
.map(|s| Ok(Path::parse(s)?.filename().unwrap().to_string())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this returning just the shortname or the full path? At the object store level, maybe it makes more sense to get the full paths? and then the lancedb layer can take just the shortname before the .lance as the table name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns the filename, which is the same behavior as the OS readdir()
call. LanceDB uses the readdir()
semantic, right? For example, to list what tables are available.
also windows failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we're returning just the filename, does it make sense anymore to return Path?
Change it back to return |
To support scan directory on local and cloud storage.