Skip to content

Commit 28305d7

Browse files
committed
Try something
Signed-off-by: Adam Gutglick <[email protected]>
1 parent cec59e2 commit 28305d7

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

benchmarks/ddb-bench/src/main.rs

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use std::path::PathBuf;
88
use clap::Parser;
99
use clap::value_parser;
1010
use ddb_bench::DuckClient;
11+
use tokio::runtime::Runtime;
1112
use vortex_bench::BenchmarkArg;
1213
use vortex_bench::CompactionStrategy;
1314
use vortex_bench::Engine;
@@ -68,8 +69,7 @@ struct Args {
6869
options: Vec<Opt>,
6970
}
7071

71-
#[tokio::main]
72-
async fn main() -> anyhow::Result<()> {
72+
fn main() -> anyhow::Result<()> {
7373
let args = Args::parse();
7474
let opts = Opts::from(args.options);
7575

@@ -85,25 +85,31 @@ async fn main() -> anyhow::Result<()> {
8585

8686
// Generate Vortex files from Parquet for any Vortex formats requested
8787
if benchmark.data_url().scheme() == "file" {
88-
benchmark.generate_base_data().await?;
89-
90-
let base_path = benchmark
91-
.data_url()
92-
.to_file_path()
93-
.map_err(|_| anyhow::anyhow!("Invalid file URL: {}", benchmark.data_url()))?;
94-
95-
for format in args.formats.iter().copied() {
96-
match format {
97-
Format::OnDiskVortex => {
98-
convert_parquet_to_vortex(&base_path, CompactionStrategy::Default).await?;
88+
let runtime = Runtime::new()?;
89+
90+
runtime.block_on(async {
91+
benchmark.generate_base_data().await?;
92+
93+
let base_path = benchmark
94+
.data_url()
95+
.to_file_path()
96+
.map_err(|_| anyhow::anyhow!("Invalid file URL: {}", benchmark.data_url()))?;
97+
98+
for format in args.formats.iter().copied() {
99+
match format {
100+
Format::OnDiskVortex => {
101+
convert_parquet_to_vortex(&base_path, CompactionStrategy::Default).await?;
102+
}
103+
Format::VortexCompact => {
104+
convert_parquet_to_vortex(&base_path, CompactionStrategy::Compact).await?;
105+
}
106+
// OnDiskDuckDB tables are created during register_tables by loading from Parquet
107+
_ => {}
99108
}
100-
Format::VortexCompact => {
101-
convert_parquet_to_vortex(&base_path, CompactionStrategy::Compact).await?;
102-
}
103-
// OnDiskDuckDB tables are created during register_tables by loading from Parquet
104-
_ => {}
105109
}
106-
}
110+
111+
anyhow::Ok(())
112+
})?;
107113
}
108114

109115
let mut runner = SqlBenchmarkRunner::new(

0 commit comments

Comments
 (0)