diff --git a/Cargo.lock b/Cargo.lock index 522c9790bec2..3bfb67f063bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6078,6 +6078,7 @@ dependencies = [ "meter-macros", "object-store", "partition", + "path-slash", "prometheus", "query", "regex", @@ -6352,6 +6353,12 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +[[package]] +name = "path-slash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" + [[package]] name = "pathdiff" version = "0.2.1" diff --git a/src/operator/Cargo.toml b/src/operator/Cargo.toml index 0543604528f9..88effdebfff3 100644 --- a/src/operator/Cargo.toml +++ b/src/operator/Cargo.toml @@ -58,3 +58,4 @@ tonic.workspace = true [dev-dependencies] common-test-util.workspace = true +path-slash = "0.2" diff --git a/src/operator/src/statement/copy_database.rs b/src/operator/src/statement/copy_database.rs index 0ab4d09cf752..63236e3eb9f6 100644 --- a/src/operator/src/statement/copy_database.rs +++ b/src/operator/src/statement/copy_database.rs @@ -206,6 +206,7 @@ mod tests { use object_store::services::Fs; use object_store::util::normalize_dir; use object_store::ObjectStore; + use path_slash::PathExt; use table::requests::CopyDatabaseRequest; use crate::statement::copy_database::{list_files_to_copy, parse_file_name_to_copy}; @@ -223,10 +224,11 @@ mod tests { object_store.write("d", "").await.unwrap(); object_store.write("e.f.parquet", "").await.unwrap(); + let location = normalize_dir(&dir.path().to_slash().unwrap()); let request = CopyDatabaseRequest { catalog_name: "catalog_0".to_string(), schema_name: "schema_0".to_string(), - location: store_dir, + location, with: [("FORMAT".to_string(), "parquet".to_string())] .into_iter() .collect(),