replace windows path chars

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Ruihang Xia
2023-09-20 11:34:00 +08:00
parent 0401f042a1
commit 5a9adcfda8
2 changed files with 7 additions and 2 deletions

View File

@@ -575,7 +575,12 @@ async fn test_execute_external_create_infer_format(instance: Arc<dyn MockInstanc
let instance = instance.frontend();
let tmp_dir = temp_dir::create_temp_dir("test_execute_external_create_infer_format");
let location = tmp_dir.path().to_str().unwrap();
let location = tmp_dir
.path()
.to_str()
.unwrap()
.replace(':', "")
.replace('\\', "/");
let output = execute_sql(
&instance,

View File

@@ -117,7 +117,7 @@ pub fn find_testing_resource(path: &str) -> String {
// We need unix style path even in the Windows, because the path is used in object-store, must
// be delimited with '/'. Inside the object-store, it will be converted to file system needed
// path in the end.
let p = p.replace('\\', "/");
let p = p.replace(':', "").replace('\\', "/");
// Prepend a '/' to indicate it's a file system path when parsed as object-store url in Windows.
format!("/{p}")