Skip to content

Commit

Permalink
Support onelake fabric paths in parse_url (#5000) (#5002)
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold authored Nov 2, 2023
1 parent 7281a0c commit ab53d2d
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion object_store/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ impl ObjectStoreScheme {
}
("http", Some(_)) => (Self::Http, url.path()),
("https", Some(host)) => {
if host.ends_with("dfs.core.windows.net") || host.ends_with("blob.core.windows.net")
if host.ends_with("dfs.core.windows.net")
|| host.ends_with("blob.core.windows.net")
|| host.ends_with("dfs.fabric.microsoft.com")
|| host.ends_with("blob.fabric.microsoft.com")
{
(Self::MicrosoftAzure, url.path())
} else if host.ends_with("amazonaws.com") {
Expand Down Expand Up @@ -251,6 +254,30 @@ mod tests {
"file:///bar%252Efoo",
(ObjectStoreScheme::Local, "bar%2Efoo"),
),
(
"abfss://[email protected]/",
(ObjectStoreScheme::MicrosoftAzure, ""),
),
(
"abfss://[email protected]/",
(ObjectStoreScheme::MicrosoftAzure, ""),
),
(
"https://account.dfs.fabric.microsoft.com/",
(ObjectStoreScheme::MicrosoftAzure, ""),
),
(
"https://account.dfs.fabric.microsoft.com/container",
(ObjectStoreScheme::MicrosoftAzure, "container"),
),
(
"https://account.blob.fabric.microsoft.com/",
(ObjectStoreScheme::MicrosoftAzure, ""),
),
(
"https://account.blob.fabric.microsoft.com/container",
(ObjectStoreScheme::MicrosoftAzure, "container"),
),
];

for (s, (expected_scheme, expected_path)) in cases {
Expand Down

0 comments on commit ab53d2d

Please sign in to comment.