From d1569f500e21a81af47c8512aff2f9456a4bfe94 Mon Sep 17 00:00:00 2001 From: yangzhong Date: Thu, 14 Jul 2022 16:22:02 +0800 Subject: [PATCH] Fix UT --- datafusion/core/src/catalog/schema.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/datafusion/core/src/catalog/schema.rs b/datafusion/core/src/catalog/schema.rs index 7634328f323ed..b886966bf6db4 100644 --- a/datafusion/core/src/catalog/schema.rs +++ b/datafusion/core/src/catalog/schema.rs @@ -162,7 +162,17 @@ mod tests { #[tokio::test] async fn test_schema_register_listing_table() { let testdata = crate::test_util::parquet_test_data(); - let filename = format!("file:///{}/{}", testdata, "alltypes_plain.parquet"); + let testdir = if testdata.starts_with('/') { + format!("file://{}", testdata) + } else { + format!("file:///{}", testdata) + }; + let filename = if testdir.ends_with('/') { + format!("{}{}", testdir, "alltypes_plain.parquet") + } else { + format!("{}/{}", testdir, "alltypes_plain.parquet") + }; + let table_path = ListingTableUrl::parse(filename).unwrap(); let catalog = MemoryCatalogProvider::new();