Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions benchmarks/random-access-bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,13 @@ fn format_to_engine(format: Format) -> Engine {
}
}

fn table_targets(formats: &[Format]) -> Vec<Target> {
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`].
Expand Down Expand Up @@ -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<v3::V3Record> = Vec::new();

Expand Down Expand Up @@ -417,7 +424,6 @@ async fn run_random_access(
None,
reopen,
);
targets.push(measurement.target);
measurements.push(measurement);
progress.inc(1);
}
Expand Down Expand Up @@ -450,7 +456,6 @@ async fn run_random_access(
Some(*pattern),
reopen,
);
targets.push(measurement.target);
measurements.push(measurement);
progress.inc(1);
}
Expand Down Expand Up @@ -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),
]
);
}
}
Loading