diff --git a/benchmarks/random-access-bench/src/main.rs b/benchmarks/random-access-bench/src/main.rs index 6543e221e33..80e608415ea 100644 --- a/benchmarks/random-access-bench/src/main.rs +++ b/benchmarks/random-access-bench/src/main.rs @@ -313,6 +313,13 @@ fn format_to_engine(format: Format) -> Engine { } } +fn table_targets(formats: &[Format]) -> Vec { + formats + .iter() + .map(|format| Target::new(format_to_engine(*format), *format)) + .collect() +} + /// Open a random accessor for any supported format. /// /// For Vortex and Parquet, the path comes from [`BenchDataset::path`]. @@ -385,7 +392,7 @@ async fn run_random_access( .sum(); let progress = ProgressBar::new(total_steps as u64); - let mut targets = Vec::new(); + let targets = table_targets(&formats); let mut measurements = Vec::new(); let mut v3_records: Vec = Vec::new(); @@ -417,7 +424,6 @@ async fn run_random_access( None, reopen, ); - targets.push(measurement.target); measurements.push(measurement); progress.inc(1); } @@ -450,7 +456,6 @@ async fn run_random_access( Some(*pattern), reopen, ); - targets.push(measurement.target); measurements.push(measurement); progress.inc(1); } @@ -531,4 +536,17 @@ mod tests { other => panic!("expected random-access record, got {other:?}"), } } + + #[test] + fn table_targets_has_one_column_per_format() { + let targets = table_targets(&[Format::Parquet, Format::OnDiskVortex]); + + assert_eq!( + targets, + vec![ + Target::new(Engine::Arrow, Format::Parquet), + Target::new(Engine::Vortex, Format::OnDiskVortex), + ] + ); + } }