Skip to content

Commit

Permalink
fix: omit common prefixes in azure
Browse files Browse the repository at this point in the history
  • Loading branch information
roeap committed Jul 10, 2022
1 parent d91ed5c commit c0dc9f9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions rust/src/storage/azure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,16 @@ impl StorageBackend for AdlsGen2Backend {
.directory(obj.path)
.into_stream()
.flat_map(|it| match it {
Ok(paths) => Either::Left(stream::iter(paths.into_iter().map(|p| {
Ok(ObjectMeta {
path: format!("adls2://{}/{}", self.file_system_name, path.to_owned()),
modified: p.last_modified,
size: Some(p.content_length),
})
Ok(paths) => Either::Left(stream::iter(paths.into_iter().flat_map(|p| {
if p.is_directory {
None
} else {
Some(Ok(ObjectMeta {
path: format!("adls2://{}/{}", self.file_system_name, p.name),
modified: p.last_modified,
size: Some(p.content_length),
}))
}
}))),
Err(err) => Either::Right(stream::once(async {
Err(StorageError::Azure { source: err })
Expand Down

0 comments on commit c0dc9f9

Please sign in to comment.