You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "kumarUjjawal (via GitHub)" <gi...@apache.org> on 2026/04/14 11:19:59 UTC
[PR] fix(benchmarks): correct TPC-H benchmark SQL [datafusion]
kumarUjjawal opened a new pull request, #21615:
URL: https://github.com/apache/datafusion/pull/21615
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
- Closes #21368.
## 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.
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
## 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.
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
## Are these changes tested?
Yes
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
-->
## Are there any user-facing changes?
TPC-H benchmark query 11 now returns correct results when the scale factor is not 1.
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api change` label.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix(benchmarks): correct TPC-H benchmark SQL [datafusion]
Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #21615:
URL: https://github.com/apache/datafusion/pull/21615#issuecomment-4249621667
๐ค Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/21615#issuecomment-4249605829)
**Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4249605829-1273-pz4d7 6.12.55+ #1 SMP Sun Feb 1 08:59:41 UTC 2026 aarch64 GNU/Linux`
<details><summary>CPU Details (lscpu)</summary>
```
Architecture: aarch64
CPU op-mode(s): 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: ARM
Model name: Neoverse-V2
Model: 1
Thread(s) per core: 1
Core(s) per cluster: 16
Socket(s): -
Cluster(s): 1
Stepping: r0p1
BogoMIPS: 2000.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache: 1 MiB (16 instances)
L1i cache: 1 MiB (16 instances)
L2 cache: 32 MiB (16 instances)
L3 cache: 80 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerability Gather data sampling: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; CSV2, BHB
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Not affected
```
</details>
Comparing fix/incorrect_tpch_queries (b2328807598bb387f32f72191f92293694db5e5b) to 6db3899 (merge-base) [diff](https://github.com/apache/datafusion/compare/6db389901c0ed61dc08d2e9fe0c42dcc789b941e..b2328807598bb387f32f72191f92293694db5e5b) using: tpch10
Results will be posted here when complete
---
[File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix(benchmarks): correct TPC-H benchmark SQL [datafusion]
Posted by "Omega359 (via GitHub)" <gi...@apache.org>.
Omega359 commented on PR #21615:
URL: https://github.com/apache/datafusion/pull/21615#issuecomment-4246135092
Thank you, this looks reasonable to me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix(benchmarks): correct TPC-H benchmark SQL [datafusion]
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on PR #21615:
URL: https://github.com/apache/datafusion/pull/21615#issuecomment-4248112740
run benchmark tpch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix(benchmarks): correct TPC-H benchmark SQL [datafusion]
Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on PR #21615:
URL: https://github.com/apache/datafusion/pull/21615#issuecomment-4243520931
cc @Omega359
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix(benchmarks): correct TPC-H benchmark SQL [datafusion]
Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #21615:
URL: https://github.com/apache/datafusion/pull/21615#issuecomment-4248124695
๐ค Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/21615#issuecomment-4248112740)
**Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4248112740-1267-dmb6r 6.12.55+ #1 SMP Sun Feb 1 08:59:41 UTC 2026 aarch64 GNU/Linux`
<details><summary>CPU Details (lscpu)</summary>
```
Architecture: aarch64
CPU op-mode(s): 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: ARM
Model name: Neoverse-V2
Model: 1
Thread(s) per core: 1
Core(s) per cluster: 16
Socket(s): -
Cluster(s): 1
Stepping: r0p1
BogoMIPS: 2000.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache: 1 MiB (16 instances)
L1i cache: 1 MiB (16 instances)
L2 cache: 32 MiB (16 instances)
L3 cache: 80 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerability Gather data sampling: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; CSV2, BHB
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Not affected
```
</details>
Comparing fix/incorrect_tpch_queries (b2328807598bb387f32f72191f92293694db5e5b) to 6db3899 (merge-base) [diff](https://github.com/apache/datafusion/compare/6db389901c0ed61dc08d2e9fe0c42dcc789b941e..b2328807598bb387f32f72191f92293694db5e5b) using: tpch
Results will be posted here when complete
---
[File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix(benchmarks): correct TPC-H benchmark SQL [datafusion]
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead merged PR #21615:
URL: https://github.com/apache/datafusion/pull/21615
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix(benchmarks): correct TPC-H benchmark SQL [datafusion]
Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #21615:
URL: https://github.com/apache/datafusion/pull/21615#issuecomment-4249702729
๐ค Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/21615#issuecomment-4249605829)
**Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB)
<details><summary>CPU Details (lscpu)</summary>
```
Architecture: aarch64
CPU op-mode(s): 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: ARM
Model name: Neoverse-V2
Model: 1
Thread(s) per core: 1
Core(s) per cluster: 16
Socket(s): -
Cluster(s): 1
Stepping: r0p1
BogoMIPS: 2000.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache: 1 MiB (16 instances)
L1i cache: 1 MiB (16 instances)
L2 cache: 32 MiB (16 instances)
L3 cache: 80 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerability Gather data sampling: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; CSV2, BHB
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Not affected
```
</details>
<details><summary>Details</summary>
<p>
```
Comparing HEAD and fix_incorrect_tpch_queries
--------------------
Benchmark tpch_sf10.json
--------------------
โโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโ
โ Query โ HEAD โ fix_incorrect_tpch_queries โ Change โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ QQuery 1 โ 371.68 / 377.77 ยฑ7.18 / 391.56 ms โ 386.96 / 389.77 ยฑ2.31 / 392.92 ms โ no change โ
โ QQuery 2 โ 138.84 / 140.85 ยฑ2.04 / 144.26 ms โ 142.84 / 147.40 ยฑ3.10 / 151.45 ms โ no change โ
โ QQuery 3 โ 301.42 / 306.17 ยฑ3.86 / 310.39 ms โ 303.36 / 316.46 ยฑ7.93 / 327.15 ms โ no change โ
โ QQuery 4 โ 157.86 / 160.52 ยฑ1.47 / 162.08 ms โ 157.04 / 161.06 ยฑ3.80 / 168.18 ms โ no change โ
โ QQuery 5 โ 437.03 / 441.92 ยฑ4.41 / 449.41 ms โ 442.33 / 450.78 ยฑ5.49 / 458.95 ms โ no change โ
โ QQuery 6 โ 134.35 / 137.83 ยฑ3.20 / 142.91 ms โ 133.88 / 135.13 ยฑ1.04 / 136.64 ms โ no change โ
โ QQuery 7 โ 565.14 / 580.64 ยฑ8.76 / 589.92 ms โ 568.20 / 574.77 ยฑ5.98 / 585.58 ms โ no change โ
โ QQuery 8 โ 485.00 / 490.17 ยฑ4.99 / 496.32 ms โ 482.46 / 491.75 ยฑ5.36 / 498.87 ms โ no change โ
โ QQuery 9 โ 685.40 / 700.85 ยฑ11.48 / 716.52 ms โ 754.49 / 756.25 ยฑ1.25 / 757.75 ms โ 1.08x slower โ
โ QQuery 10 โ 359.08 / 373.95 ยฑ9.11 / 384.92 ms โ 361.48 / 371.09 ยฑ6.40 / 378.12 ms โ no change โ
โ QQuery 11 โ 113.63 / 118.22 ยฑ4.45 / 124.86 ms โ 111.12 / 116.93 ยฑ5.13 / 124.03 ms โ no change โ
โ QQuery 12 โ 216.24 / 218.52 ยฑ2.77 / 223.83 ms โ 205.37 / 208.31 ยฑ2.91 / 212.23 ms โ no change โ
โ QQuery 13 โ 327.29 / 344.05 ยฑ13.16 / 362.68 ms โ 317.54 / 325.72 ยฑ6.51 / 334.84 ms โ +1.06x faster โ
โ QQuery 14 โ 186.03 / 187.78 ยฑ1.67 / 190.55 ms โ 185.09 / 187.42 ยฑ1.68 / 189.13 ms โ no change โ
โ QQuery 15 โ 338.21 / 341.11 ยฑ1.83 / 343.50 ms โ 335.95 / 340.66 ยฑ3.45 / 346.48 ms โ no change โ
โ QQuery 16 โ 86.70 / 88.61 ยฑ1.04 / 89.61 ms โ 84.72 / 87.02 ยฑ1.55 / 88.88 ms โ no change โ
โ QQuery 17 โ 772.10 / 795.05 ยฑ38.52 / 871.59 ms โ 777.90 / 781.61 ยฑ3.86 / 788.53 ms โ no change โ
โ QQuery 18 โ 921.63 / 980.73 ยฑ29.96 / 1001.64 ms โ 856.32 / 880.41 ยฑ14.57 / 900.50 ms โ +1.11x faster โ
โ QQuery 19 โ 283.44 / 288.08 ยฑ3.69 / 292.62 ms โ 276.40 / 287.65 ยฑ6.56 / 294.24 ms โ no change โ
โ QQuery 20 โ 329.71 / 335.29 ยฑ4.51 / 339.96 ms โ 349.71 / 357.44 ยฑ9.31 / 375.19 ms โ 1.07x slower โ
โ QQuery 21 โ 862.94 / 871.83 ยฑ6.96 / 883.46 ms โ 870.66 / 914.81 ยฑ37.40 / 969.33 ms โ no change โ
โ QQuery 22 โ 85.37 / 87.62 ยฑ1.81 / 90.50 ms โ 81.75 / 83.29 ยฑ1.03 / 84.96 ms โ no change โ
โโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโ
โ Benchmark Summary โ โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ Total Time (HEAD) โ 8367.55ms โ
โ Total Time (fix_incorrect_tpch_queries) โ 8365.70ms โ
โ Average Time (HEAD) โ 380.34ms โ
โ Average Time (fix_incorrect_tpch_queries) โ 380.26ms โ
โ Queries Faster โ 2 โ
โ Queries Slower โ 2 โ
โ Queries with No Change โ 18 โ
โ Queries with Failure โ 0 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโ
```
</p>
</details>
<details><summary>Resource Usage</summary>
**tpch10 โ base (merge-base)**
| Metric | Value |
|--------|-------|
| Wall time | 42.3s |
| Peak memory | 10.1 GiB |
| Avg memory | 7.7 GiB |
| CPU user | 441.2s |
| CPU sys | 30.8s |
| Peak spill | 0 B |
**tpch10 โ branch**
| Metric | Value |
|--------|-------|
| Wall time | 42.2s |
| Peak memory | 10.2 GiB |
| Avg memory | 7.8 GiB |
| CPU user | 440.4s |
| CPU sys | 30.9s |
| Peak spill | 0 B |
</details>
---
[File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix(benchmarks): correct TPC-H benchmark SQL [datafusion]
Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on PR #21615:
URL: https://github.com/apache/datafusion/pull/21615#issuecomment-4249605829
run benchmark tpch10
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org