Skip to content

Commit 2830e80

Browse files
committed
One DuckDB fix
Signed-off-by: Adam Gutglick <[email protected]>
1 parent 5d2c600 commit 2830e80

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

benchmarks/ddb-bench/src/lib.rs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff 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
}

vortex-bench/src/benchmark.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use crate::BenchmarkDataset;
1111
use crate::Format;
1212

1313
/// Specification for a table in a benchmark dataset.
14+
#[derive(Debug)]
1415
pub struct TableSpec {
1516
pub name: &'static str,
1617
pub schema: Option<Schema>,

0 commit comments

Comments
 (0)