Skip to content

Commit ab53d2d

Browse files
authored
Support onelake fabric paths in parse_url (#5000) (#5002)
1 parent 7281a0c commit ab53d2d

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

object_store/src/parse.rs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ impl ObjectStoreScheme {
8181
}
8282
("http", Some(_)) => (Self::Http, url.path()),
8383
("https", Some(host)) => {
84-
if host.ends_with("dfs.core.windows.net") || host.ends_with("blob.core.windows.net")
84+
if host.ends_with("dfs.core.windows.net")
85+
|| host.ends_with("blob.core.windows.net")
86+
|| host.ends_with("dfs.fabric.microsoft.com")
87+
|| host.ends_with("blob.fabric.microsoft.com")
8588
{
8689
(Self::MicrosoftAzure, url.path())
8790
} else if host.ends_with("amazonaws.com") {
@@ -251,6 +254,30 @@ mod tests {
251254
"file:///bar%252Efoo",
252255
(ObjectStoreScheme::Local, "bar%2Efoo"),
253256
),
257+
(
258+
"abfss://file_system@account.dfs.fabric.microsoft.com/",
259+
(ObjectStoreScheme::MicrosoftAzure, ""),
260+
),
261+
(
262+
"abfss://file_system@account.dfs.fabric.microsoft.com/",
263+
(ObjectStoreScheme::MicrosoftAzure, ""),
264+
),
265+
(
266+
"https://account.dfs.fabric.microsoft.com/",
267+
(ObjectStoreScheme::MicrosoftAzure, ""),
268+
),
269+
(
270+
"https://account.dfs.fabric.microsoft.com/container",
271+
(ObjectStoreScheme::MicrosoftAzure, "container"),
272+
),
273+
(
274+
"https://account.blob.fabric.microsoft.com/",
275+
(ObjectStoreScheme::MicrosoftAzure, ""),
276+
),
277+
(
278+
"https://account.blob.fabric.microsoft.com/container",
279+
(ObjectStoreScheme::MicrosoftAzure, "container"),
280+
),
254281
];
255282

256283
for (s, (expected_scheme, expected_path)) in cases {

0 commit comments

Comments
 (0)