Skip to content

Commit

Permalink
Mismatched row counting respects query list (#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 authored Aug 14, 2024
1 parent b650874 commit 79a22c3
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions bench-vortex/src/bin/tpch_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,31 +186,32 @@ async fn bench_main(queries: Option<Vec<usize>>) -> ExitCode {
.or_insert_with(|| vec![0; EXPECTED_ROW_COUNTS.len()])[idx] = row_count;
}

let mut rows = vec![];
while let Ok((idx, row)) = rows_rx.recv() {
rows.push((idx, row));
}
rows.sort_by(|(idx0, _), (idx1, _)| idx0.cmp(idx1));
for (_, row) in rows {
table.add_row(row);
}

progress.finish();
table.printstd();

let mut mismatched = false;
for (format, row_counts) in format_row_counts {
row_counts
.into_iter()
.zip_eq(EXPECTED_ROW_COUNTS)
.enumerate()
.filter(|(idx, _)| queries.as_ref().map(|q| q.contains(idx)).unwrap_or(true))
.for_each(|(idx, (row_count, expected_row_count))| {
if row_count != expected_row_count {
println!("Mismatched row count {row_count} instead of {expected_row_count} in query {idx} for format {format:?}");
mismatched = true;
}
})
}

let mut rows = vec![];
while let Ok((idx, row)) = rows_rx.recv() {
rows.push((idx, row));
}
rows.sort_by(|(idx0, _), (idx1, _)| idx0.cmp(idx1));
for (_, row) in rows {
table.add_row(row);
}

progress.finish();
table.printstd();
if mismatched {
ExitCode::FAILURE
} else {
Expand Down

0 comments on commit 79a22c3

Please sign in to comment.