File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44//! Generic benchmark runner infrastructure to reduce boilerplate across engine-specific benchmarks.
55
6+ use std:: collections:: HashSet ;
67use std:: fs:: File ;
78use std:: future:: Future ;
89use 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) ;
You can’t perform that action at this time.
0 commit comments