Skip to content

fix(benchmarks): correct TPC-H benchmark SQL#21615

Open
kumarUjjawal wants to merge 2 commits intoapache:mainfrom
kumarUjjawal:fix/incorrect_tpch_queries
Open

fix(benchmarks): correct TPC-H benchmark SQL#21615
kumarUjjawal wants to merge 2 commits intoapache:mainfrom
kumarUjjawal:fix/incorrect_tpch_queries

Conversation

@kumarUjjawal
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

TPC-H query 11 was using a fixed 0.0001 threshold in the HAVING clause. Per the TPC-H spec, this value must be 0.0001 / SF.

This means the benchmark query is only correct for scale factor 1. For larger scale factors the filter becomes too
strict, and for smaller scale factors it becomes too loose.

There are also few benchmark queries using fixed end dates where the spec uses date + interval. Those are equivalent but using intervals matches the TPC-H query definitions more closely.

What changes are included in this PR?

  • Make TPC-H query 11 use scale-factor substitution.
  • Add scale factor support in the benchmark runner.
  • Infer scale factor from dataset paths like tpch_sf10.
  • Pass the scale factor from bench.sh.
  • Keep the old query-loading entry point working with the
    default scale factor of 1.
  • Update query 5, 6, 10, 12, and 14 to use interval-based
    date ranges.
  • Add regression tests for scale-factor substitution,
    scale-factor parsing, and invalid scale factors.

Are these changes tested?

Yes

Are there any user-facing changes?

TPC-H benchmark query 11 now returns correct results when the scale factor is not 1.

@kumarUjjawal
Copy link
Copy Markdown
Contributor Author

cc @Omega359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A few TPCH benchmark queries are incorrect causing issues when scale factor > 1

1 participant