Skip to content

Commit

Permalink
feat: use object-store's s3 store if copy-if-not-exists headers are s…
Browse files Browse the repository at this point in the history
…pecified (#1356)
  • Loading branch information
roeap authored and rtyler committed Sep 25, 2023
1 parent 21b9483 commit 05e6444
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions rust/src/storage/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,18 @@ pub(crate) fn configure_store(
ObjectStoreScheme::AmazonS3 => {
options.with_env_s3();
let (store, prefix) = parse_url_opts(url, options.as_s3_options())?;
let store =
S3StorageBackend::try_new(Arc::new(store), S3StorageOptions::from_map(&options.0))?;
url_prefix_handler(store, prefix)
if options
.as_s3_options()
.contains_key(&AmazonS3ConfigKey::CopyIfNotExists)
{
url_prefix_handler(store, prefix)
} else {
let store = S3StorageBackend::try_new(
Arc::new(store),
S3StorageOptions::from_map(&options.0),
)?;
url_prefix_handler(store, prefix)
}
}
#[cfg(feature = "azure")]
ObjectStoreScheme::MicrosoftAzure => {
Expand Down

0 comments on commit 05e6444

Please sign in to comment.