diff --git a/rust/src/builder/azure.rs b/rust/src/builder/azure.rs index 448f8379ad..cad578832c 100644 --- a/rust/src/builder/azure.rs +++ b/rust/src/builder/azure.rs @@ -5,6 +5,7 @@ use crate::DeltaResult; use object_store::azure::MicrosoftAzureBuilder; use once_cell::sync::Lazy; +use percent_encoding::percent_decode_str; #[derive(PartialEq, Eq)] enum AzureConfigKey { @@ -220,6 +221,9 @@ fn parse_boolean(term: &str) -> Option { } fn split_sas(sas: &str) -> Result, BuilderError> { + let sas = percent_decode_str(sas) + .decode_utf8() + .map_err(|err| BuilderError::Decode(err.to_string()))?; let kv_str_pairs = sas .trim_start_matches('?') .split('&') diff --git a/rust/src/builder/mod.rs b/rust/src/builder/mod.rs index 05f64efe65..4184f0d3dc 100644 --- a/rust/src/builder/mod.rs +++ b/rust/src/builder/mod.rs @@ -37,6 +37,8 @@ enum BuilderError { Required(String), #[error("Failed to find valid credential.")] MissingCredential, + #[error("Failed to decode sas key. {0}")] + Decode(String), } impl From for DeltaTableError {