File tree Expand file tree Collapse file tree 2 files changed +17
-11
lines changed
Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -49,22 +49,27 @@ impl DuckClient {
4949 delete_database : bool ,
5050 threads : Option < usize > ,
5151 ) -> Result < Self > {
52- let base_path = data_url
53- . to_file_path ( )
54- . map_err ( |_| anyhow:: anyhow!( "Invalid file URL: {}" , data_url) ) ?;
55- let dir = base_path. join ( format. name ( ) ) ;
56- std:: fs:: create_dir_all ( & dir) ?;
57- let db_path = dir. join ( "duckdb.db" ) ;
58- if delete_database && db_path. exists ( ) {
59- std:: fs:: remove_file ( & db_path) ?;
60- }
52+ let db_path = if data_url. scheme ( ) != "file" {
53+ None
54+ } else {
55+ let base_path = data_url
56+ . to_file_path ( )
57+ . map_err ( |_| anyhow:: anyhow!( "Invalid file URL: {}" , data_url) ) ?;
58+ let dir = base_path. join ( format. name ( ) ) ;
59+ std:: fs:: create_dir_all ( & dir) ?;
60+ let db_path = dir. join ( "duckdb.db" ) ;
61+ if delete_database && db_path. exists ( ) {
62+ std:: fs:: remove_file ( & db_path) ?;
63+ }
64+ Some ( db_path)
65+ } ;
6166
62- let ( db, connection) = Self :: open_and_setup_database ( Some ( db_path. clone ( ) ) , threads) ?;
67+ let ( db, connection) = Self :: open_and_setup_database ( db_path. clone ( ) , threads) ?;
6368
6469 Ok ( Self {
6570 db,
6671 connection,
67- db_path : Some ( db_path ) ,
72+ db_path,
6873 threads,
6974 } )
7075 }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ use crate::BenchmarkDataset;
1111use crate :: Format ;
1212
1313/// Specification for a table in a benchmark dataset.
14+ #[ derive( Debug ) ]
1415pub struct TableSpec {
1516 pub name : & ' static str ,
1617 pub schema : Option < Schema > ,
You can’t perform that action at this time.
0 commit comments