Skip to content

Commit

Permalink
fix: omit common prefixes in azure (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
roeap authored Jul 11, 2022
1 parent d91ed5c commit 9229dee
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions rust/src/storage/azure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,21 @@ 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().filter_map(|p| {
if p.is_directory {
None
} else {
Some(Ok(ObjectMeta {
path: format!(
"adls2://{}/{}/{}",
obj.account_name.to_owned(),
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 9229dee

Please sign in to comment.