Skip to content

Commit 5912909

Browse files
committed
chore: dedup formats in sql enginer runner
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
1 parent 3188e24 commit 5912909

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

vortex-bench/src/runner.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
//! Generic benchmark runner infrastructure to reduce boilerplate across engine-specific benchmarks.
55
6+
use std::collections::HashSet;
67
use std::fs::File;
78
use std::future::Future;
89
use std::io::Write;
@@ -67,6 +68,7 @@ pub struct SqlBenchmarkRunner {
6768
benchmark_dataset: BenchmarkDataset,
6869
storage: String,
6970
expected_row_counts: Option<Vec<usize>>,
71+
/// Deduplicated, preserving insertion order.
7072
formats: Vec<Format>,
7173
memory_tracker: Option<BenchmarkMemoryTracker>,
7274
hide_progress_bar: bool,
@@ -79,10 +81,12 @@ impl SqlBenchmarkRunner {
7981
pub fn new<B: Benchmark + ?Sized>(
8082
benchmark: &B,
8183
engine: Engine,
82-
formats: Vec<Format>,
84+
formats: impl IntoIterator<Item = Format>,
8385
track_memory: bool,
8486
hide_progress_bar: bool,
8587
) -> anyhow::Result<Self> {
88+
let mut seen = HashSet::new();
89+
let formats: Vec<Format> = formats.into_iter().filter(|f| seen.insert(*f)).collect();
8690
let storage = url_scheme_to_storage(benchmark.data_url())?;
8791

8892
let memory_tracker = track_memory.then(BenchmarkMemoryTracker::new);

0 commit comments

Comments
 (0)