You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "847850277 (via GitHub)" <gi...@apache.org> on 2026/08/03 01:22:00 UTC
Re: [PR] fix: preserve ABFS container in object store registry keys [datafusion]
847850277 commented on code in PR #23935:
URL: https://github.com/apache/datafusion/pull/23935#discussion_r3700828610
##########
datafusion/execution/src/object_store.rs:
##########
@@ -263,14 +263,22 @@ impl ObjectStoreRegistry for DefaultObjectStoreRegistry {
}
}
-/// Get the key of a url for object store registration.
-/// The credential info will be removed
+/// Get the key of a URL for object store registration.
+///
+/// The username portion of userinfo is preserved for ABFS schemes, where it
+/// identifies a namespace. Passwords and userinfo for other schemes are removed.
fn get_url_key(url: &Url) -> String {
- format!(
- "{}://{}",
- url.scheme(),
- &url[url::Position::BeforeHost..url::Position::AfterPort],
- )
+ let key_authority = match url.scheme() {
+ // ABFS encodes the container namespace in URL userinfo.
+ "abfs" | "abfss" if !url.username().is_empty() => format!(
+ "{}@{}",
+ &url[url::Position::BeforeUsername..url::Position::AfterUsername],
+ &url[url::Position::BeforeHost..url::Position::AfterPort],
+ ),
+ _ => url[url::Position::BeforeHost..url::Position::AfterPort].to_string(),
+ };
+
+ format!("{}://{key_authority}", url.scheme())
Review Comment:
updata.
##########
datafusion/execution/src/object_store.rs:
##########
@@ -263,14 +263,22 @@ impl ObjectStoreRegistry for DefaultObjectStoreRegistry {
}
}
-/// Get the key of a url for object store registration.
-/// The credential info will be removed
+/// Get the key of a URL for object store registration.
+///
+/// The username portion of userinfo is preserved for ABFS schemes, where it
+/// identifies a namespace. Passwords and userinfo for other schemes are removed.
fn get_url_key(url: &Url) -> String {
- format!(
- "{}://{}",
- url.scheme(),
- &url[url::Position::BeforeHost..url::Position::AfterPort],
- )
+ let key_authority = match url.scheme() {
+ // ABFS encodes the container namespace in URL userinfo.
+ "abfs" | "abfss" if !url.username().is_empty() => format!(
+ "{}@{}",
+ &url[url::Position::BeforeUsername..url::Position::AfterUsername],
+ &url[url::Position::BeforeHost..url::Position::AfterPort],
+ ),
+ _ => url[url::Position::BeforeHost..url::Position::AfterPort].to_string(),
+ };
+
+ format!("{}://{key_authority}", url.scheme())
Review Comment:
update.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org