Draft
Conversation
Contributor
Author
|
Moved to draft as I need to de-duplicate the validation between integration tests and the benchmark suite. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds post-benchmark correctness validation that compares query results against known-good expected results stored as Parquet files.
What it does:
After all benchmark queries complete, each query's saved Parquet output is compared row-by-row against an expected result file using DuckDB for loading and the existing assert_rows_equal/normalize_rows comparison utilities. Validation output appears after the benchmark summary table.
How expected results are located:
Explicitly via --expected-results-dir (CLI flag on run_benchmark.sh / pytest option)
Auto-derived from the schema's data path by appending _expected (e.g. $PRESTO_DATA_DIR/sf1 -> $PRESTO_DATA_DIR/sf1_expected)
If neither exists, validation is skipped with a message.
Handling LIMIT queries:
Queries with LIMIT require special handling because the result set can be non-deterministic. The validation classifies each query using sqlglot:
No LIMIT: all columns compared
LIMIT with deterministic ORDER BY (raw columns, COUNT, etc.): only ORDER BY columns are compared, since non-ORDER BY columns can differ at the LIMIT boundary due to ties
LIMIT with float aggregate ORDER BY (SUM, AVG): validation skipped entirely, since distributed floating-point aggregation can change the ranking and thus which rows appear in the result set across runs. We should be able to remove this once decimal support is in, but for now it seems to be non-deterministic.