@@ -4,7 +4,10 @@ use std::time::{Duration, Instant};
4
4
use bench_vortex:: display:: { print_measurements_json, render_table, DisplayFormat } ;
5
5
use bench_vortex:: measurements:: QueryMeasurement ;
6
6
use bench_vortex:: tpch:: dbgen:: { DBGen , DBGenOptions } ;
7
- use bench_vortex:: tpch:: { load_datasets, run_tpch_query, tpch_queries, EXPECTED_ROW_COUNTS } ;
7
+ use bench_vortex:: tpch:: {
8
+ load_datasets, run_tpch_query, tpch_queries, EXPECTED_ROW_COUNTS_SF1 , EXPECTED_ROW_COUNTS_SF10 ,
9
+ TPC_H_ROW_COUNT_ARRAY_LENGTH ,
10
+ } ;
8
11
use bench_vortex:: { default_env_filter, feature_flagged_allocator, setup_logger, Format } ;
9
12
use clap:: Parser ;
10
13
use indicatif:: ProgressBar ;
@@ -106,6 +109,7 @@ fn main() -> ExitCode {
106
109
args. formats ,
107
110
args. display_format ,
108
111
args. emulate_object_store ,
112
+ args. scale_factor ,
109
113
url,
110
114
) )
111
115
}
@@ -118,8 +122,20 @@ async fn bench_main(
118
122
formats : Vec < Format > ,
119
123
display_format : DisplayFormat ,
120
124
emulate_object_store : bool ,
125
+ scale_factor : u8 ,
121
126
url : Url ,
122
127
) -> ExitCode {
128
+ let expected_row_counts = if scale_factor == 1 {
129
+ EXPECTED_ROW_COUNTS_SF1
130
+ } else if scale_factor == 10 {
131
+ EXPECTED_ROW_COUNTS_SF10
132
+ } else {
133
+ panic ! (
134
+ "Scale factor {} not supported due to lack of expected row counts." ,
135
+ scale_factor
136
+ ) ;
137
+ } ;
138
+
123
139
eprintln ! (
124
140
"Benchmarking against these formats: {}." ,
125
141
formats. iter( ) . join( ", " )
@@ -196,7 +212,7 @@ async fn bench_main(
196
212
for ( idx, format, row_count) in row_counts {
197
213
format_row_counts
198
214
. entry ( format)
199
- . or_insert_with ( || vec ! [ 0 ; EXPECTED_ROW_COUNTS . len ( ) ] ) [ idx] = row_count;
215
+ . or_insert_with ( || vec ! [ 0 ; TPC_H_ROW_COUNT_ARRAY_LENGTH ] ) [ idx] = row_count;
200
216
}
201
217
202
218
progress. finish ( ) ;
@@ -205,14 +221,29 @@ async fn bench_main(
205
221
for ( format, row_counts) in format_row_counts {
206
222
row_counts
207
223
. into_iter ( )
208
- . zip_eq ( EXPECTED_ROW_COUNTS )
209
224
. enumerate ( )
210
225
. filter ( |( idx, _) | queries. as_ref ( ) . map ( |q| q. contains ( idx) ) . unwrap_or ( true ) )
211
226
. filter ( |( idx, _) | exclude_queries. as_ref ( ) . map ( |excluded| !excluded. contains ( idx) ) . unwrap_or ( true ) )
212
- . for_each ( |( idx, ( row_count, expected_row_count) ) | {
213
- if row_count != expected_row_count {
214
- eprintln ! ( "Mismatched row count {row_count} instead of {expected_row_count} in query {idx} for format {format:?}" ) ;
215
- mismatched = true ;
227
+ . for_each ( |( idx, actual_row_count) | {
228
+ let expected_row_count = expected_row_counts[ idx] ;
229
+ if actual_row_count != expected_row_count {
230
+ if idx == 15 && actual_row_count == 0 {
231
+ eprintln ! (
232
+ "*IGNORING* mismatched row count {} instead of {} for format {:?} because Query 15 is flaky. See: https://github.com/spiraldb/vortex/issues/2395" ,
233
+ actual_row_count,
234
+ expected_row_count,
235
+ format,
236
+ ) ;
237
+ } else {
238
+ eprintln ! (
239
+ "Mismatched row count {} instead of {} in query {} for format {:?}" ,
240
+ actual_row_count,
241
+ expected_row_count,
242
+ idx,
243
+ format,
244
+ ) ;
245
+ mismatched = true ;
246
+ }
216
247
}
217
248
} )
218
249
}
0 commit comments