Skip to content

chore: convert PartialHashAggregateStream to async generators and cleanup - #24017

Open
rluvaton wants to merge 16 commits into
apache:mainfrom
rluvaton:move-final-hash-stream
Open

chore: convert PartialHashAggregateStream to async generators and cleanup#24017
rluvaton wants to merge 16 commits into
apache:mainfrom
rluvaton:move-final-hash-stream

Conversation

@rluvaton

@rluvaton rluvaton commented Jul 30, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Related to:

Rationale for this change

Cleanup the code and remove state

What changes are included in this PR?

changed PartialHashAggregateStream to async generator and remove unneeded code due to that

Are these changes tested?

existing tests

Are there any user-facing changes?

nope

@rluvaton

Copy link
Copy Markdown
Member Author

run benchmarks

@rluvaton

Copy link
Copy Markdown
Member Author

run benchmark tpcds

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c5135541577-1310-tcc6h 6.12.85+ #1 SMP Mon May 11 08:17:35 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
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

Comparing move-final-hash-stream (8a49479) to 541caab (merge-base) diff using: tpcds
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c5135541577-1309-sp8vc 6.12.85+ #1 SMP Mon May 11 08:17:35 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
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

Comparing move-final-hash-stream (8a49479) to 541caab (merge-base) diff using: clickbench_partitioned
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c5135541577-1311-kxx4x 6.12.85+ #1 SMP Mon May 11 08:17:35 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
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

Comparing move-final-hash-stream (8a49479) to 541caab (merge-base) diff using: tpch
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c5135555306-1312-k2q88 6.12.85+ #1 SMP Mon May 11 08:17:35 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
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

Comparing move-final-hash-stream (8a49479) to 541caab (merge-base) diff using: tpcds
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

CPU Details (lscpu)
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 HEAD and move-final-hash-stream
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                           HEAD ┃         move-final-hash-stream ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │ 40.48 / 42.01 ±1.42 / 43.80 ms │ 40.84 / 41.42 ±1.09 / 43.60 ms │     no change │
│ QQuery 2  │ 20.27 / 20.87 ±0.83 / 22.45 ms │ 20.69 / 20.90 ±0.18 / 21.13 ms │     no change │
│ QQuery 3  │ 33.45 / 35.66 ±1.34 / 37.32 ms │ 33.25 / 36.40 ±1.75 / 38.40 ms │     no change │
│ QQuery 4  │ 18.64 / 18.96 ±0.41 / 19.74 ms │ 18.90 / 19.03 ±0.13 / 19.23 ms │     no change │
│ QQuery 5  │ 42.33 / 44.51 ±1.62 / 47.16 ms │ 42.26 / 43.54 ±1.01 / 44.79 ms │     no change │
│ QQuery 6  │ 17.72 / 18.01 ±0.19 / 18.26 ms │ 17.75 / 18.29 ±0.63 / 19.35 ms │     no change │
│ QQuery 7  │ 50.35 / 52.04 ±1.02 / 53.51 ms │ 48.80 / 51.38 ±2.64 / 55.51 ms │     no change │
│ QQuery 8  │ 45.32 / 46.60 ±1.37 / 49.28 ms │ 46.12 / 46.53 ±0.42 / 47.29 ms │     no change │
│ QQuery 9  │ 54.44 / 55.57 ±0.88 / 56.85 ms │ 54.06 / 54.76 ±0.46 / 55.48 ms │     no change │
│ QQuery 10 │ 46.34 / 47.79 ±1.15 / 49.14 ms │ 46.24 / 46.54 ±0.30 / 47.01 ms │     no change │
│ QQuery 11 │ 14.97 / 15.18 ±0.27 / 15.68 ms │ 14.73 / 14.90 ±0.13 / 15.13 ms │     no change │
│ QQuery 12 │ 25.19 / 26.03 ±0.64 / 27.02 ms │ 25.77 / 27.03 ±1.57 / 30.13 ms │     no change │
│ QQuery 13 │ 36.31 / 36.59 ±0.29 / 36.99 ms │ 34.52 / 36.01 ±1.08 / 37.27 ms │     no change │
│ QQuery 14 │ 25.36 / 25.72 ±0.31 / 26.13 ms │ 25.67 / 26.50 ±1.05 / 28.57 ms │     no change │
│ QQuery 15 │ 34.20 / 35.22 ±1.11 / 36.66 ms │ 34.04 / 34.61 ±0.47 / 35.34 ms │     no change │
│ QQuery 16 │ 14.92 / 15.29 ±0.41 / 16.04 ms │ 14.94 / 15.18 ±0.13 / 15.29 ms │     no change │
│ QQuery 17 │ 83.81 / 85.08 ±0.99 / 86.47 ms │ 71.86 / 77.32 ±5.53 / 84.74 ms │ +1.10x faster │
│ QQuery 18 │ 64.77 / 66.57 ±1.10 / 68.02 ms │ 59.29 / 60.65 ±0.80 / 61.57 ms │ +1.10x faster │
│ QQuery 19 │ 35.30 / 36.37 ±1.22 / 38.23 ms │ 33.49 / 34.00 ±0.40 / 34.71 ms │ +1.07x faster │
│ QQuery 20 │ 34.69 / 35.09 ±0.24 / 35.36 ms │ 32.51 / 33.33 ±0.53 / 33.93 ms │ +1.05x faster │
│ QQuery 21 │ 62.49 / 65.68 ±2.78 / 70.45 ms │ 56.28 / 58.14 ±1.80 / 61.49 ms │ +1.13x faster │
│ QQuery 22 │ 15.35 / 15.61 ±0.17 / 15.83 ms │ 15.28 / 15.58 ±0.19 / 15.86 ms │     no change │
└───────────┴────────────────────────────────┴────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                     ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                     │ 840.43ms │
│ Total Time (move-final-hash-stream)   │ 812.02ms │
│ Average Time (HEAD)                   │  38.20ms │
│ Average Time (move-final-hash-stream) │  36.91ms │
│ Queries Faster                        │        5 │
│ Queries Slower                        │        0 │
│ Queries with No Change                │       17 │
│ Queries with Failure                  │        0 │
└───────────────────────────────────────┴──────────┘

Resource Usage

tpch — base (merge-base)

Metric Value
Wall time 5.0s
Peak memory 1.1 GiB
Avg memory 696.6 MiB
CPU user 23.4s
CPU sys 2.0s
Peak spill 0 B

tpch — branch

Metric Value
Wall time 5.0s
Peak memory 1.2 GiB
Avg memory 684.6 MiB
CPU user 23.3s
CPU sys 2.0s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

CPU Details (lscpu)
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 HEAD and move-final-hash-stream
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query     ┃                                   HEAD ┃                move-final-hash-stream ┃    Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1  │            5.45 / 5.95 ±0.94 / 7.82 ms │           5.45 / 5.99 ±0.91 / 7.82 ms │ no change │
│ QQuery 2  │         80.41 / 80.88 ±0.27 / 81.21 ms │        81.43 / 81.85 ±0.30 / 82.29 ms │ no change │
│ QQuery 3  │         29.75 / 30.05 ±0.24 / 30.35 ms │        29.19 / 29.54 ±0.28 / 29.85 ms │ no change │
│ QQuery 4  │      487.92 / 493.77 ±6.28 / 505.33 ms │     495.03 / 500.75 ±4.10 / 507.67 ms │ no change │
│ QQuery 5  │         51.82 / 52.61 ±0.58 / 53.49 ms │        52.08 / 52.62 ±0.32 / 53.01 ms │ no change │
│ QQuery 6  │         36.40 / 37.00 ±0.51 / 37.85 ms │        37.01 / 37.20 ±0.18 / 37.53 ms │ no change │
│ QQuery 7  │         94.04 / 95.06 ±0.64 / 95.83 ms │        95.03 / 95.52 ±0.32 / 95.82 ms │ no change │
│ QQuery 8  │         37.10 / 38.71 ±2.10 / 42.76 ms │        37.32 / 38.04 ±0.46 / 38.49 ms │ no change │
│ QQuery 9  │         51.74 / 54.74 ±2.91 / 59.55 ms │        53.18 / 54.69 ±0.83 / 55.48 ms │ no change │
│ QQuery 10 │         63.24 / 63.76 ±0.36 / 64.16 ms │        63.38 / 63.79 ±0.26 / 64.13 ms │ no change │
│ QQuery 11 │      301.16 / 310.47 ±5.36 / 316.20 ms │     305.68 / 311.85 ±5.14 / 320.58 ms │ no change │
│ QQuery 12 │         28.73 / 29.26 ±0.34 / 29.81 ms │        28.90 / 29.38 ±0.33 / 29.80 ms │ no change │
│ QQuery 13 │      118.09 / 118.55 ±0.28 / 118.96 ms │     118.59 / 120.08 ±2.02 / 124.03 ms │ no change │
│ QQuery 14 │      411.35 / 415.44 ±2.65 / 418.88 ms │     416.13 / 418.66 ±1.78 / 420.75 ms │ no change │
│ QQuery 15 │         57.88 / 58.68 ±0.54 / 59.55 ms │        58.51 / 59.91 ±1.22 / 62.00 ms │ no change │
│ QQuery 16 │            6.65 / 6.80 ±0.22 / 7.23 ms │           6.64 / 6.89 ±0.31 / 7.49 ms │ no change │
│ QQuery 17 │         79.94 / 81.29 ±1.85 / 84.96 ms │        79.98 / 81.23 ±1.24 / 83.62 ms │ no change │
│ QQuery 18 │      122.88 / 124.85 ±2.62 / 129.98 ms │     123.57 / 125.20 ±1.87 / 127.52 ms │ no change │
│ QQuery 19 │         41.59 / 41.98 ±0.26 / 42.30 ms │        41.76 / 42.01 ±0.18 / 42.28 ms │ no change │
│ QQuery 20 │         35.74 / 37.02 ±1.54 / 40.01 ms │        36.11 / 36.29 ±0.12 / 36.41 ms │ no change │
│ QQuery 21 │         17.82 / 18.06 ±0.28 / 18.60 ms │        17.84 / 18.44 ±0.88 / 20.18 ms │ no change │
│ QQuery 22 │         63.57 / 64.03 ±0.51 / 64.78 ms │        63.28 / 64.18 ±1.01 / 65.94 ms │ no change │
│ QQuery 23 │      345.31 / 350.86 ±4.32 / 355.92 ms │    344.99 / 356.96 ±17.51 / 391.77 ms │ no change │
│ QQuery 24 │      224.91 / 227.63 ±3.10 / 233.38 ms │     226.17 / 228.08 ±2.78 / 233.59 ms │ no change │
│ QQuery 25 │      109.46 / 110.60 ±0.66 / 111.39 ms │     110.57 / 111.22 ±0.79 / 112.75 ms │ no change │
│ QQuery 26 │         58.40 / 59.50 ±1.11 / 61.58 ms │        58.97 / 59.87 ±0.79 / 61.00 ms │ no change │
│ QQuery 27 │            6.24 / 6.36 ±0.13 / 6.60 ms │           6.22 / 6.39 ±0.21 / 6.81 ms │ no change │
│ QQuery 28 │         60.95 / 61.59 ±0.69 / 62.88 ms │        57.84 / 60.96 ±1.67 / 62.35 ms │ no change │
│ QQuery 29 │        97.62 / 99.63 ±1.97 / 102.10 ms │      98.07 / 100.14 ±1.97 / 103.35 ms │ no change │
│ QQuery 30 │         33.24 / 34.07 ±0.60 / 34.77 ms │        33.27 / 34.74 ±1.87 / 38.37 ms │ no change │
│ QQuery 31 │      111.73 / 112.39 ±0.56 / 113.13 ms │     112.06 / 112.91 ±1.08 / 114.81 ms │ no change │
│ QQuery 32 │         20.89 / 21.05 ±0.15 / 21.31 ms │        20.43 / 20.76 ±0.33 / 21.32 ms │ no change │
│ QQuery 33 │         38.21 / 38.39 ±0.10 / 38.50 ms │        37.88 / 38.32 ±0.56 / 39.39 ms │ no change │
│ QQuery 34 │          9.81 / 10.09 ±0.26 / 10.42 ms │         9.98 / 10.35 ±0.35 / 10.99 ms │ no change │
│ QQuery 35 │         73.30 / 74.45 ±1.07 / 75.79 ms │        73.50 / 74.35 ±1.00 / 76.05 ms │ no change │
│ QQuery 36 │            5.73 / 5.91 ±0.24 / 6.38 ms │           5.88 / 6.09 ±0.21 / 6.49 ms │ no change │
│ QQuery 37 │            6.77 / 6.88 ±0.07 / 6.98 ms │           6.91 / 7.02 ±0.06 / 7.06 ms │ no change │
│ QQuery 38 │         61.73 / 62.53 ±0.59 / 63.48 ms │        62.69 / 63.09 ±0.22 / 63.33 ms │ no change │
│ QQuery 39 │         91.39 / 92.17 ±0.71 / 93.18 ms │        91.02 / 91.74 ±0.63 / 92.83 ms │ no change │
│ QQuery 40 │         23.70 / 24.19 ±0.35 / 24.66 ms │        23.76 / 24.27 ±0.45 / 24.97 ms │ no change │
│ QQuery 41 │         11.54 / 11.78 ±0.17 / 12.06 ms │        11.53 / 11.78 ±0.25 / 12.27 ms │ no change │
│ QQuery 42 │         23.77 / 24.40 ±0.63 / 25.59 ms │        24.16 / 24.35 ±0.20 / 24.71 ms │ no change │
│ QQuery 43 │            4.96 / 5.09 ±0.19 / 5.45 ms │           4.95 / 5.11 ±0.18 / 5.45 ms │ no change │
│ QQuery 44 │            9.28 / 9.44 ±0.16 / 9.71 ms │           9.32 / 9.47 ±0.11 / 9.57 ms │ no change │
│ QQuery 45 │         38.43 / 39.23 ±0.59 / 40.15 ms │        38.18 / 38.76 ±0.48 / 39.42 ms │ no change │
│ QQuery 46 │         11.97 / 12.08 ±0.07 / 12.16 ms │        11.94 / 12.64 ±0.75 / 14.06 ms │ no change │
│ QQuery 47 │      227.34 / 233.46 ±5.70 / 243.37 ms │     228.13 / 231.79 ±2.64 / 235.11 ms │ no change │
│ QQuery 48 │         96.80 / 97.30 ±0.40 / 97.81 ms │        96.40 / 96.83 ±0.24 / 97.08 ms │ no change │
│ QQuery 49 │         76.16 / 77.06 ±0.82 / 78.16 ms │        76.29 / 77.05 ±0.53 / 77.67 ms │ no change │
│ QQuery 50 │         59.65 / 62.68 ±4.17 / 70.95 ms │        59.68 / 60.33 ±0.70 / 61.67 ms │ no change │
│ QQuery 51 │         93.01 / 94.81 ±1.23 / 96.34 ms │        91.06 / 92.62 ±0.87 / 93.61 ms │ no change │
│ QQuery 52 │         24.03 / 24.45 ±0.26 / 24.84 ms │        24.47 / 24.61 ±0.16 / 24.90 ms │ no change │
│ QQuery 53 │         29.45 / 31.95 ±4.35 / 40.64 ms │        29.57 / 31.67 ±2.83 / 37.26 ms │ no change │
│ QQuery 54 │         55.72 / 56.88 ±1.16 / 58.89 ms │        55.80 / 56.55 ±0.46 / 57.12 ms │ no change │
│ QQuery 55 │         23.79 / 24.18 ±0.41 / 24.91 ms │        23.52 / 24.04 ±0.38 / 24.56 ms │ no change │
│ QQuery 56 │         39.15 / 39.98 ±0.54 / 40.58 ms │        39.26 / 39.44 ±0.15 / 39.65 ms │ no change │
│ QQuery 57 │      177.63 / 179.97 ±1.34 / 181.24 ms │     178.75 / 180.12 ±1.10 / 181.24 ms │ no change │
│ QQuery 58 │      116.61 / 117.75 ±0.97 / 119.35 ms │     115.10 / 116.67 ±1.07 / 118.01 ms │ no change │
│ QQuery 59 │      119.02 / 119.52 ±0.40 / 120.01 ms │     119.19 / 119.61 ±0.37 / 120.18 ms │ no change │
│ QQuery 60 │         39.32 / 39.78 ±0.35 / 40.19 ms │        39.87 / 40.11 ±0.19 / 40.36 ms │ no change │
│ QQuery 61 │         12.32 / 12.54 ±0.22 / 12.84 ms │        12.49 / 12.63 ±0.17 / 12.95 ms │ no change │
│ QQuery 62 │         47.05 / 48.74 ±2.03 / 52.48 ms │        47.24 / 47.79 ±0.91 / 49.60 ms │ no change │
│ QQuery 63 │         29.90 / 30.16 ±0.24 / 30.58 ms │        29.79 / 30.52 ±0.56 / 31.35 ms │ no change │
│ QQuery 64 │      408.72 / 417.32 ±7.58 / 429.71 ms │     413.76 / 416.40 ±2.60 / 420.76 ms │ no change │
│ QQuery 65 │      123.31 / 130.07 ±6.28 / 141.20 ms │     126.96 / 130.22 ±5.11 / 140.39 ms │ no change │
│ QQuery 66 │         80.75 / 82.00 ±1.18 / 84.06 ms │        81.23 / 81.82 ±0.51 / 82.41 ms │ no change │
│ QQuery 67 │      242.06 / 249.91 ±5.35 / 258.25 ms │     240.52 / 249.70 ±9.45 / 267.88 ms │ no change │
│ QQuery 68 │         11.95 / 12.24 ±0.16 / 12.44 ms │        11.77 / 11.95 ±0.20 / 12.32 ms │ no change │
│ QQuery 69 │         57.68 / 59.39 ±2.76 / 64.88 ms │        57.63 / 59.83 ±3.77 / 67.35 ms │ no change │
│ QQuery 70 │      105.77 / 108.13 ±3.19 / 114.27 ms │     105.57 / 108.90 ±4.53 / 117.85 ms │ no change │
│ QQuery 71 │         35.81 / 36.20 ±0.41 / 36.97 ms │        35.59 / 36.03 ±0.60 / 37.21 ms │ no change │
│ QQuery 72 │ 2077.53 / 2197.10 ±101.42 / 2353.08 ms │ 2148.90 / 2174.85 ±16.05 / 2194.93 ms │ no change │
│ QQuery 73 │           9.65 / 9.91 ±0.23 / 10.30 ms │          9.62 / 9.92 ±0.30 / 10.33 ms │ no change │
│ QQuery 74 │      176.43 / 179.96 ±4.31 / 188.45 ms │     173.09 / 174.51 ±1.35 / 176.40 ms │ no change │
│ QQuery 75 │      149.74 / 150.83 ±0.90 / 151.76 ms │     148.95 / 150.32 ±1.07 / 151.76 ms │ no change │
│ QQuery 76 │         35.48 / 35.97 ±0.41 / 36.44 ms │        35.62 / 35.83 ±0.31 / 36.43 ms │ no change │
│ QQuery 77 │         61.39 / 61.74 ±0.25 / 62.14 ms │        61.82 / 62.27 ±0.50 / 63.13 ms │ no change │
│ QQuery 78 │      198.87 / 201.07 ±2.90 / 206.54 ms │     199.61 / 201.91 ±2.08 / 204.87 ms │ no change │
│ QQuery 79 │         68.03 / 71.41 ±4.16 / 79.61 ms │        68.48 / 70.70 ±2.62 / 75.38 ms │ no change │
│ QQuery 80 │      100.33 / 101.30 ±1.34 / 103.95 ms │      99.57 / 101.33 ±1.52 / 103.58 ms │ no change │
│ QQuery 81 │         26.14 / 26.25 ±0.08 / 26.39 ms │        26.42 / 26.60 ±0.09 / 26.66 ms │ no change │
│ QQuery 82 │         16.19 / 16.37 ±0.15 / 16.61 ms │        16.38 / 16.73 ±0.33 / 17.25 ms │ no change │
│ QQuery 83 │         39.54 / 44.69 ±5.87 / 55.40 ms │        40.85 / 44.01 ±4.09 / 50.98 ms │ no change │
│ QQuery 84 │         30.36 / 30.66 ±0.26 / 31.01 ms │        30.45 / 30.98 ±0.44 / 31.61 ms │ no change │
│ QQuery 85 │      107.03 / 107.38 ±0.32 / 107.78 ms │     106.57 / 107.70 ±0.70 / 108.50 ms │ no change │
│ QQuery 86 │         25.40 / 25.59 ±0.14 / 25.77 ms │        25.51 / 25.84 ±0.18 / 26.03 ms │ no change │
│ QQuery 87 │         63.16 / 65.78 ±4.39 / 74.55 ms │        61.90 / 64.99 ±2.92 / 70.27 ms │ no change │
│ QQuery 88 │         63.13 / 63.80 ±0.39 / 64.27 ms │        63.56 / 64.30 ±0.56 / 65.15 ms │ no change │
│ QQuery 89 │         36.09 / 36.39 ±0.18 / 36.65 ms │        36.17 / 36.42 ±0.27 / 36.84 ms │ no change │
│ QQuery 90 │         17.04 / 17.27 ±0.19 / 17.62 ms │        17.28 / 17.60 ±0.29 / 17.98 ms │ no change │
│ QQuery 91 │         45.45 / 47.99 ±3.74 / 55.39 ms │        46.07 / 47.75 ±2.31 / 52.31 ms │ no change │
│ QQuery 92 │         29.39 / 30.09 ±0.51 / 30.93 ms │        30.20 / 30.46 ±0.17 / 30.71 ms │ no change │
│ QQuery 93 │         50.10 / 51.19 ±0.76 / 52.40 ms │        50.84 / 51.44 ±0.38 / 51.96 ms │ no change │
│ QQuery 94 │         38.19 / 38.77 ±0.38 / 39.34 ms │        38.36 / 38.61 ±0.21 / 38.92 ms │ no change │
│ QQuery 95 │         80.53 / 82.37 ±2.71 / 87.73 ms │        80.34 / 82.03 ±1.50 / 84.82 ms │ no change │
│ QQuery 96 │         24.30 / 24.47 ±0.24 / 24.95 ms │        24.53 / 24.63 ±0.10 / 24.81 ms │ no change │
│ QQuery 97 │         46.66 / 46.96 ±0.17 / 47.15 ms │        47.06 / 48.30 ±1.34 / 50.86 ms │ no change │
│ QQuery 98 │         43.22 / 43.51 ±0.18 / 43.74 ms │        43.02 / 43.88 ±0.51 / 44.51 ms │ no change │
│ QQuery 99 │         70.64 / 73.49 ±4.88 / 83.23 ms │        70.82 / 71.34 ±0.27 / 71.54 ms │ no change │
└───────────┴────────────────────────────────────────┴───────────────────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                     ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                     │ 10028.06ms │
│ Total Time (move-final-hash-stream)   │ 10015.93ms │
│ Average Time (HEAD)                   │   101.29ms │
│ Average Time (move-final-hash-stream) │   101.17ms │
│ Queries Faster                        │          0 │
│ Queries Slower                        │          0 │
│ Queries with No Change                │         99 │
│ Queries with Failure                  │          0 │
└───────────────────────────────────────┴────────────┘

Resource Usage

tpcds — base (merge-base)

Metric Value
Wall time 55.0s
Peak memory 2.0 GiB
Avg memory 1.3 GiB
CPU user 228.6s
CPU sys 5.9s
Peak spill 0 B

tpcds — branch

Metric Value
Wall time 55.0s
Peak memory 2.1 GiB
Avg memory 1.4 GiB
CPU user 229.2s
CPU sys 5.7s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

CPU Details (lscpu)
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 HEAD and move-final-hash-stream
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃                move-final-hash-stream ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │           5.44 / 5.97 ±0.97 / 7.90 ms │           5.63 / 6.08 ±0.81 / 7.70 ms │     no change │
│ QQuery 2  │        81.29 / 81.50 ±0.20 / 81.79 ms │        82.68 / 82.97 ±0.26 / 83.39 ms │     no change │
│ QQuery 3  │        29.89 / 30.14 ±0.18 / 30.34 ms │        30.27 / 30.44 ±0.11 / 30.60 ms │     no change │
│ QQuery 4  │     489.13 / 493.88 ±4.37 / 501.51 ms │     492.70 / 502.62 ±6.66 / 511.72 ms │     no change │
│ QQuery 5  │        52.04 / 52.73 ±0.45 / 53.22 ms │        53.14 / 53.79 ±0.47 / 54.33 ms │     no change │
│ QQuery 6  │        36.99 / 37.26 ±0.17 / 37.50 ms │        37.54 / 38.11 ±0.62 / 38.87 ms │     no change │
│ QQuery 7  │        94.42 / 95.05 ±0.50 / 95.62 ms │       94.18 / 96.23 ±2.70 / 101.52 ms │     no change │
│ QQuery 8  │        37.22 / 38.70 ±2.53 / 43.74 ms │        37.08 / 37.71 ±0.75 / 39.13 ms │     no change │
│ QQuery 9  │        52.68 / 55.13 ±1.74 / 57.88 ms │        53.03 / 55.27 ±1.45 / 56.86 ms │     no change │
│ QQuery 10 │        63.41 / 63.99 ±0.36 / 64.44 ms │        63.85 / 64.31 ±0.34 / 64.79 ms │     no change │
│ QQuery 11 │     307.14 / 311.14 ±3.01 / 316.12 ms │     303.97 / 305.51 ±1.81 / 309.01 ms │     no change │
│ QQuery 12 │        28.77 / 29.44 ±0.40 / 29.78 ms │        29.05 / 29.46 ±0.31 / 29.85 ms │     no change │
│ QQuery 13 │     118.56 / 120.07 ±1.24 / 122.11 ms │     118.96 / 122.57 ±3.35 / 128.20 ms │     no change │
│ QQuery 14 │     415.20 / 418.19 ±2.49 / 421.06 ms │    417.18 / 425.58 ±13.89 / 453.21 ms │     no change │
│ QQuery 15 │        58.27 / 59.17 ±0.83 / 60.25 ms │        58.46 / 59.55 ±0.91 / 61.21 ms │     no change │
│ QQuery 16 │           6.66 / 6.81 ±0.23 / 7.26 ms │           6.86 / 7.08 ±0.26 / 7.58 ms │     no change │
│ QQuery 17 │        80.62 / 81.71 ±1.29 / 84.12 ms │        80.26 / 81.22 ±0.96 / 83.05 ms │     no change │
│ QQuery 18 │     124.24 / 127.06 ±2.22 / 130.07 ms │     123.34 / 124.48 ±0.92 / 125.52 ms │     no change │
│ QQuery 19 │        42.14 / 42.32 ±0.24 / 42.80 ms │        42.16 / 42.56 ±0.25 / 42.92 ms │     no change │
│ QQuery 20 │        35.93 / 36.48 ±0.58 / 37.32 ms │        36.22 / 36.48 ±0.18 / 36.69 ms │     no change │
│ QQuery 21 │        18.02 / 18.98 ±1.65 / 22.27 ms │        18.12 / 18.38 ±0.24 / 18.79 ms │     no change │
│ QQuery 22 │        63.57 / 64.49 ±0.98 / 66.38 ms │        63.46 / 64.11 ±0.53 / 64.81 ms │     no change │
│ QQuery 23 │     349.18 / 350.59 ±1.57 / 353.56 ms │     344.31 / 350.36 ±4.14 / 355.49 ms │     no change │
│ QQuery 24 │     226.03 / 229.32 ±4.09 / 236.60 ms │     225.31 / 226.64 ±1.50 / 229.42 ms │     no change │
│ QQuery 25 │     110.46 / 111.61 ±0.88 / 112.85 ms │     111.35 / 112.38 ±0.85 / 113.95 ms │     no change │
│ QQuery 26 │        57.44 / 60.10 ±2.03 / 62.29 ms │        58.21 / 59.31 ±0.90 / 60.63 ms │     no change │
│ QQuery 27 │           6.22 / 6.34 ±0.17 / 6.66 ms │           6.19 / 6.36 ±0.22 / 6.79 ms │     no change │
│ QQuery 28 │        57.58 / 60.00 ±2.14 / 62.74 ms │        58.31 / 61.70 ±1.76 / 63.19 ms │     no change │
│ QQuery 29 │        97.60 / 98.27 ±0.87 / 99.97 ms │      97.04 / 101.30 ±5.67 / 112.51 ms │     no change │
│ QQuery 30 │        33.24 / 35.02 ±1.24 / 36.69 ms │        33.20 / 34.13 ±0.66 / 35.09 ms │     no change │
│ QQuery 31 │     112.32 / 113.13 ±0.76 / 114.40 ms │     112.64 / 112.95 ±0.22 / 113.24 ms │     no change │
│ QQuery 32 │        20.84 / 21.28 ±0.25 / 21.59 ms │        20.71 / 20.99 ±0.17 / 21.19 ms │     no change │
│ QQuery 33 │        37.87 / 38.56 ±0.47 / 39.24 ms │        38.94 / 39.31 ±0.21 / 39.50 ms │     no change │
│ QQuery 34 │         9.98 / 10.66 ±0.54 / 11.31 ms │         9.99 / 10.16 ±0.23 / 10.61 ms │     no change │
│ QQuery 35 │        74.18 / 75.10 ±1.28 / 77.57 ms │        73.99 / 74.43 ±0.38 / 74.99 ms │     no change │
│ QQuery 36 │           5.98 / 6.12 ±0.21 / 6.53 ms │           6.03 / 6.16 ±0.18 / 6.50 ms │     no change │
│ QQuery 37 │           6.92 / 7.09 ±0.14 / 7.35 ms │           6.91 / 7.07 ±0.09 / 7.19 ms │     no change │
│ QQuery 38 │        62.92 / 63.67 ±0.44 / 64.21 ms │        62.41 / 62.78 ±0.30 / 63.15 ms │     no change │
│ QQuery 39 │        90.90 / 92.98 ±2.31 / 97.18 ms │        91.37 / 93.87 ±2.76 / 99.03 ms │     no change │
│ QQuery 40 │        23.98 / 24.33 ±0.46 / 25.21 ms │        23.71 / 23.87 ±0.15 / 24.09 ms │     no change │
│ QQuery 41 │        11.64 / 11.76 ±0.18 / 12.11 ms │        11.79 / 12.08 ±0.21 / 12.44 ms │     no change │
│ QQuery 42 │        24.32 / 25.03 ±0.85 / 26.67 ms │        24.13 / 24.38 ±0.14 / 24.49 ms │     no change │
│ QQuery 43 │           4.94 / 5.07 ±0.16 / 5.37 ms │           5.10 / 5.23 ±0.17 / 5.57 ms │     no change │
│ QQuery 44 │           9.17 / 9.33 ±0.14 / 9.57 ms │          9.50 / 9.73 ±0.21 / 10.03 ms │     no change │
│ QQuery 45 │        38.52 / 39.21 ±0.45 / 39.70 ms │        37.91 / 38.83 ±0.54 / 39.48 ms │     no change │
│ QQuery 46 │        11.93 / 12.11 ±0.20 / 12.48 ms │        12.39 / 13.02 ±0.85 / 14.70 ms │  1.08x slower │
│ QQuery 47 │     229.49 / 231.54 ±1.69 / 233.95 ms │     229.13 / 233.50 ±3.66 / 239.07 ms │     no change │
│ QQuery 48 │        96.93 / 97.43 ±0.45 / 98.02 ms │        97.33 / 98.30 ±0.75 / 99.61 ms │     no change │
│ QQuery 49 │        77.41 / 77.75 ±0.30 / 78.13 ms │        77.94 / 80.33 ±3.48 / 87.21 ms │     no change │
│ QQuery 50 │        59.82 / 61.76 ±1.87 / 64.03 ms │        59.79 / 60.42 ±0.49 / 61.18 ms │     no change │
│ QQuery 51 │        93.93 / 94.70 ±0.76 / 95.99 ms │        91.12 / 93.81 ±1.74 / 96.35 ms │     no change │
│ QQuery 52 │        23.95 / 24.36 ±0.27 / 24.70 ms │        24.25 / 24.46 ±0.19 / 24.78 ms │     no change │
│ QQuery 53 │        29.91 / 30.21 ±0.27 / 30.66 ms │        30.21 / 32.20 ±3.08 / 38.32 ms │  1.07x slower │
│ QQuery 54 │        56.32 / 58.88 ±2.43 / 62.00 ms │        56.31 / 56.90 ±0.40 / 57.41 ms │     no change │
│ QQuery 55 │        24.09 / 24.18 ±0.08 / 24.30 ms │        23.57 / 24.13 ±0.37 / 24.67 ms │     no change │
│ QQuery 56 │        39.78 / 39.98 ±0.17 / 40.20 ms │        39.52 / 40.01 ±0.55 / 41.01 ms │     no change │
│ QQuery 57 │     177.11 / 178.74 ±2.07 / 182.82 ms │     177.32 / 180.30 ±3.07 / 185.32 ms │     no change │
│ QQuery 58 │     116.82 / 118.19 ±2.20 / 122.56 ms │     116.27 / 118.37 ±1.66 / 120.39 ms │     no change │
│ QQuery 59 │     119.35 / 119.60 ±0.24 / 119.90 ms │     119.15 / 119.96 ±0.65 / 120.74 ms │     no change │
│ QQuery 60 │        40.31 / 40.44 ±0.09 / 40.55 ms │        39.91 / 41.60 ±2.51 / 46.56 ms │     no change │
│ QQuery 61 │        12.08 / 12.32 ±0.14 / 12.51 ms │        12.25 / 12.34 ±0.14 / 12.62 ms │     no change │
│ QQuery 62 │        47.23 / 48.96 ±1.70 / 51.01 ms │        46.74 / 47.00 ±0.20 / 47.30 ms │     no change │
│ QQuery 63 │        29.84 / 30.24 ±0.46 / 31.10 ms │        29.77 / 30.08 ±0.25 / 30.44 ms │     no change │
│ QQuery 64 │     408.54 / 416.52 ±5.67 / 425.16 ms │     410.69 / 413.64 ±2.63 / 417.86 ms │     no change │
│ QQuery 65 │     128.76 / 131.64 ±1.71 / 133.40 ms │     128.02 / 130.44 ±1.67 / 132.92 ms │     no change │
│ QQuery 66 │        80.60 / 82.40 ±2.78 / 87.93 ms │        80.77 / 81.17 ±0.30 / 81.62 ms │     no change │
│ QQuery 67 │     241.65 / 248.43 ±6.56 / 258.31 ms │     244.63 / 248.45 ±2.34 / 251.61 ms │     no change │
│ QQuery 68 │        11.90 / 12.03 ±0.18 / 12.38 ms │        12.02 / 12.27 ±0.23 / 12.66 ms │     no change │
│ QQuery 69 │        57.76 / 60.09 ±3.87 / 67.81 ms │        58.59 / 60.73 ±3.15 / 66.99 ms │     no change │
│ QQuery 70 │     105.41 / 108.71 ±3.79 / 116.11 ms │     105.86 / 109.85 ±3.66 / 116.65 ms │     no change │
│ QQuery 71 │        35.45 / 35.98 ±0.35 / 36.51 ms │        35.59 / 35.96 ±0.22 / 36.22 ms │     no change │
│ QQuery 72 │ 2156.71 / 2238.61 ±43.44 / 2277.53 ms │ 2162.78 / 2258.38 ±70.44 / 2381.61 ms │     no change │
│ QQuery 73 │          9.77 / 9.94 ±0.18 / 10.25 ms │         9.88 / 10.18 ±0.27 / 10.59 ms │     no change │
│ QQuery 74 │     172.50 / 176.14 ±4.30 / 184.26 ms │     173.81 / 175.48 ±1.42 / 177.85 ms │     no change │
│ QQuery 75 │     149.92 / 156.09 ±6.83 / 169.39 ms │     148.62 / 149.62 ±1.01 / 150.99 ms │     no change │
│ QQuery 76 │        35.80 / 36.02 ±0.22 / 36.44 ms │        35.72 / 38.69 ±5.39 / 49.47 ms │  1.07x slower │
│ QQuery 77 │        61.53 / 64.34 ±2.59 / 68.87 ms │        62.16 / 64.05 ±1.56 / 66.86 ms │     no change │
│ QQuery 78 │     199.11 / 203.94 ±3.77 / 209.44 ms │     199.97 / 204.93 ±6.37 / 217.37 ms │     no change │
│ QQuery 79 │        68.24 / 68.68 ±0.33 / 69.08 ms │        68.01 / 68.66 ±0.45 / 69.07 ms │     no change │
│ QQuery 80 │      99.17 / 100.34 ±1.06 / 102.19 ms │     100.74 / 101.67 ±0.75 / 102.57 ms │     no change │
│ QQuery 81 │        26.93 / 31.39 ±5.21 / 40.53 ms │        26.41 / 26.68 ±0.18 / 26.89 ms │ +1.18x faster │
│ QQuery 82 │        17.20 / 17.69 ±0.54 / 18.47 ms │        16.56 / 17.33 ±0.94 / 19.17 ms │     no change │
│ QQuery 83 │        41.54 / 41.76 ±0.14 / 41.98 ms │        40.60 / 41.00 ±0.35 / 41.41 ms │     no change │
│ QQuery 84 │        30.74 / 30.94 ±0.22 / 31.35 ms │        30.40 / 30.67 ±0.15 / 30.88 ms │     no change │
│ QQuery 85 │     107.69 / 111.43 ±3.65 / 117.93 ms │     108.23 / 110.17 ±2.80 / 115.73 ms │     no change │
│ QQuery 86 │        26.11 / 26.59 ±0.26 / 26.86 ms │        25.57 / 26.04 ±0.37 / 26.64 ms │     no change │
│ QQuery 87 │        63.82 / 64.94 ±1.04 / 66.76 ms │        62.74 / 63.76 ±0.94 / 65.53 ms │     no change │
│ QQuery 88 │        64.10 / 64.49 ±0.30 / 64.96 ms │        64.38 / 66.81 ±3.91 / 74.62 ms │     no change │
│ QQuery 89 │        36.65 / 39.10 ±3.57 / 46.16 ms │        36.87 / 37.53 ±1.04 / 39.58 ms │     no change │
│ QQuery 90 │        17.55 / 17.87 ±0.23 / 18.16 ms │        17.22 / 17.75 ±0.33 / 18.23 ms │     no change │
│ QQuery 91 │        47.34 / 47.62 ±0.19 / 47.83 ms │        46.65 / 47.14 ±0.38 / 47.64 ms │     no change │
│ QQuery 92 │        30.73 / 31.43 ±0.55 / 32.26 ms │        29.58 / 30.98 ±0.99 / 32.40 ms │     no change │
│ QQuery 93 │        51.05 / 52.11 ±0.92 / 53.49 ms │        49.95 / 50.84 ±0.64 / 51.74 ms │     no change │
│ QQuery 94 │        38.62 / 41.70 ±4.55 / 50.71 ms │        39.19 / 40.46 ±1.19 / 42.57 ms │     no change │
│ QQuery 95 │        83.60 / 85.06 ±1.69 / 88.26 ms │        81.35 / 82.58 ±0.85 / 83.50 ms │     no change │
│ QQuery 96 │        24.78 / 24.97 ±0.20 / 25.32 ms │        24.46 / 24.74 ±0.28 / 25.24 ms │     no change │
│ QQuery 97 │        47.87 / 48.19 ±0.27 / 48.65 ms │        47.54 / 48.06 ±0.71 / 49.44 ms │     no change │
│ QQuery 98 │        43.46 / 45.67 ±2.26 / 49.72 ms │        42.76 / 44.24 ±1.20 / 45.81 ms │     no change │
│ QQuery 99 │        72.06 / 72.30 ±0.26 / 72.81 ms │        71.53 / 71.86 ±0.21 / 72.14 ms │     no change │
└───────────┴───────────────────────────────────────┴───────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                     ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                     │ 10111.29ms │
│ Total Time (move-final-hash-stream)   │ 10128.11ms │
│ Average Time (HEAD)                   │   102.13ms │
│ Average Time (move-final-hash-stream) │   102.30ms │
│ Queries Faster                        │          1 │
│ Queries Slower                        │          3 │
│ Queries with No Change                │         95 │
│ Queries with Failure                  │          0 │
└───────────────────────────────────────┴────────────┘

Resource Usage

tpcds — base (merge-base)

Metric Value
Wall time 55.0s
Peak memory 1.8 GiB
Avg memory 1.3 GiB
CPU user 230.2s
CPU sys 6.0s
Peak spill 0 B

tpcds — branch

Metric Value
Wall time 55.0s
Peak memory 2.1 GiB
Avg memory 1.4 GiB
CPU user 228.8s
CPU sys 5.4s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

CPU Details (lscpu)
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 HEAD and move-final-hash-stream
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃                move-final-hash-stream ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │          1.28 / 4.06 ±5.50 / 15.06 ms │          1.26 / 3.98 ±5.38 / 14.73 ms │     no change │
│ QQuery 1  │        12.82 / 12.94 ±0.10 / 13.06 ms │        13.84 / 13.98 ±0.13 / 14.14 ms │  1.08x slower │
│ QQuery 2  │        36.33 / 37.13 ±1.24 / 39.59 ms │        37.01 / 37.40 ±0.25 / 37.71 ms │     no change │
│ QQuery 3  │        31.07 / 31.64 ±0.56 / 32.67 ms │        31.22 / 31.45 ±0.18 / 31.78 ms │     no change │
│ QQuery 4  │     223.00 / 225.33 ±2.68 / 230.30 ms │     221.31 / 226.54 ±4.33 / 234.40 ms │     no change │
│ QQuery 5  │     271.25 / 272.77 ±1.67 / 275.98 ms │     269.59 / 270.93 ±0.85 / 272.16 ms │     no change │
│ QQuery 6  │           1.31 / 1.46 ±0.24 / 1.94 ms │           1.31 / 1.47 ±0.23 / 1.93 ms │     no change │
│ QQuery 7  │        13.72 / 14.11 ±0.30 / 14.61 ms │        15.14 / 15.25 ±0.09 / 15.41 ms │  1.08x slower │
│ QQuery 8  │     322.55 / 328.00 ±4.48 / 335.94 ms │     322.56 / 325.71 ±2.50 / 329.21 ms │     no change │
│ QQuery 9  │     443.05 / 457.84 ±9.40 / 471.99 ms │     455.90 / 466.10 ±7.89 / 476.00 ms │     no change │
│ QQuery 10 │        69.23 / 70.48 ±1.28 / 72.23 ms │        69.87 / 70.75 ±0.56 / 71.33 ms │     no change │
│ QQuery 11 │        81.78 / 82.70 ±0.93 / 84.34 ms │       82.34 / 87.39 ±8.37 / 104.09 ms │  1.06x slower │
│ QQuery 12 │     266.07 / 271.21 ±5.26 / 279.36 ms │     264.77 / 272.19 ±8.94 / 288.24 ms │     no change │
│ QQuery 13 │     365.52 / 370.26 ±4.73 / 377.72 ms │     366.17 / 377.19 ±8.62 / 392.58 ms │     no change │
│ QQuery 14 │     280.40 / 286.13 ±5.60 / 296.69 ms │     280.12 / 287.74 ±8.12 / 298.06 ms │     no change │
│ QQuery 15 │     271.15 / 274.98 ±2.41 / 278.56 ms │     268.74 / 274.87 ±4.37 / 281.11 ms │     no change │
│ QQuery 16 │     609.13 / 618.19 ±5.55 / 626.17 ms │     606.77 / 618.23 ±9.17 / 634.46 ms │     no change │
│ QQuery 17 │     612.56 / 618.94 ±7.77 / 633.20 ms │    614.54 / 632.97 ±21.47 / 675.08 ms │     no change │
│ QQuery 18 │ 1245.20 / 1275.60 ±21.58 / 1307.79 ms │ 1241.87 / 1267.83 ±23.82 / 1310.81 ms │     no change │
│ QQuery 19 │        28.10 / 31.39 ±3.75 / 37.20 ms │        28.83 / 33.49 ±8.85 / 51.18 ms │  1.07x slower │
│ QQuery 20 │     517.22 / 526.15 ±8.49 / 541.46 ms │     516.66 / 524.65 ±5.62 / 533.86 ms │     no change │
│ QQuery 21 │     521.26 / 523.93 ±4.67 / 533.26 ms │     518.82 / 533.81 ±8.64 / 541.42 ms │     no change │
│ QQuery 22 │    981.40 / 991.42 ±8.54 / 1006.41 ms │  998.23 / 1009.44 ±10.57 / 1029.22 ms │     no change │
│ QQuery 23 │ 3059.75 / 3078.47 ±12.90 / 3099.56 ms │ 3063.01 / 3085.09 ±15.45 / 3107.48 ms │     no change │
│ QQuery 24 │        42.17 / 52.03 ±7.04 / 62.46 ms │        41.69 / 42.33 ±0.86 / 43.97 ms │ +1.23x faster │
│ QQuery 25 │     111.34 / 115.10 ±3.66 / 120.97 ms │     111.08 / 112.98 ±2.17 / 117.15 ms │     no change │
│ QQuery 26 │        41.31 / 41.82 ±0.62 / 43.04 ms │        41.60 / 42.28 ±0.43 / 42.96 ms │     no change │
│ QQuery 27 │     510.53 / 523.06 ±7.13 / 532.44 ms │     513.28 / 518.52 ±4.91 / 525.17 ms │     no change │
│ QQuery 28 │ 2871.77 / 2896.39 ±16.98 / 2921.87 ms │ 2888.44 / 2912.21 ±12.67 / 2925.33 ms │     no change │
│ QQuery 29 │       42.66 / 53.60 ±11.70 / 75.82 ms │       41.75 / 52.92 ±14.20 / 76.70 ms │     no change │
│ QQuery 30 │    293.73 / 308.99 ±10.24 / 325.15 ms │     303.14 / 315.21 ±8.89 / 325.31 ms │     no change │
│ QQuery 31 │    279.89 / 299.18 ±14.11 / 322.55 ms │     295.67 / 301.50 ±6.68 / 313.60 ms │     no change │
│ QQuery 32 │    934.59 / 959.07 ±19.64 / 983.07 ms │   926.82 / 974.50 ±34.95 / 1035.58 ms │     no change │
│ QQuery 33 │ 1434.59 / 1476.06 ±24.39 / 1511.24 ms │ 1440.65 / 1476.88 ±26.75 / 1517.66 ms │     no change │
│ QQuery 34 │ 1438.11 / 1476.63 ±29.44 / 1512.07 ms │ 1492.35 / 1518.38 ±22.47 / 1551.04 ms │     no change │
│ QQuery 35 │    274.38 / 306.97 ±35.30 / 366.48 ms │    284.31 / 300.54 ±20.09 / 335.85 ms │     no change │
│ QQuery 36 │        65.79 / 70.45 ±3.64 / 76.40 ms │        67.97 / 71.83 ±3.32 / 77.46 ms │     no change │
│ QQuery 37 │        35.38 / 35.94 ±0.37 / 36.48 ms │        35.74 / 37.82 ±3.46 / 44.70 ms │  1.05x slower │
│ QQuery 38 │        41.54 / 43.56 ±2.83 / 49.17 ms │        43.19 / 47.18 ±3.69 / 51.77 ms │  1.08x slower │
│ QQuery 39 │    140.69 / 152.69 ±10.97 / 173.15 ms │     138.56 / 148.97 ±6.73 / 157.56 ms │     no change │
│ QQuery 40 │        14.50 / 14.67 ±0.18 / 14.91 ms │        14.65 / 17.74 ±4.22 / 25.49 ms │  1.21x slower │
│ QQuery 41 │        13.59 / 15.69 ±2.65 / 20.73 ms │        13.66 / 14.06 ±0.32 / 14.63 ms │ +1.12x faster │
│ QQuery 42 │        13.28 / 14.37 ±1.83 / 18.01 ms │        13.15 / 15.01 ±3.15 / 21.27 ms │     no change │
└───────────┴───────────────────────────────────────┴───────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                     ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                     │ 19261.38ms │
│ Total Time (move-final-hash-stream)   │ 19389.31ms │
│ Average Time (HEAD)                   │   447.94ms │
│ Average Time (move-final-hash-stream) │   450.91ms │
│ Queries Faster                        │          2 │
│ Queries Slower                        │          7 │
│ Queries with No Change                │         34 │
│ Queries with Failure                  │          0 │
└───────────────────────────────────────┴────────────┘

Resource Usage

clickbench_partitioned — base (merge-base)

Metric Value
Wall time 100.0s
Peak memory 10.9 GiB
Avg memory 4.0 GiB
CPU user 990.2s
CPU sys 67.6s
Peak spill 0 B

clickbench_partitioned — branch

Metric Value
Wall time 100.0s
Peak memory 11.0 GiB
Avg memory 4.4 GiB
CPU user 992.0s
CPU sys 71.0s
Peak spill 0 B

File an issue against this benchmark runner

@codecov-commenter

codecov-commenter commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.82171% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.62%. Comparing base (406c0c6) to head (7b2528c).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...fusion/physical-plan/src/aggregates/hash_stream.rs 86.71% 3 Missing and 14 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24017      +/-   ##
==========================================
- Coverage   81.62%   81.62%   -0.01%     
==========================================
  Files        1123     1123              
  Lines      409524   409400     -124     
  Branches   409524   409400     -124     
==========================================
- Hits       334294   334179     -115     
+ Misses      55594    55572      -22     
- Partials    19636    19649      +13     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@2010YOUY01

Copy link
Copy Markdown
Contributor

Could we delay those cleanup PRs after #22710 is functionally complete?

Now we're in a inconsistent state, and I think it's better to fully remove the legacy implementation sooner, and next we can continue cleaning things up. I estimate it's ~3 PRs away from that, I'll update in the EPIC issue when it's ready.

@alamb
alamb marked this pull request as draft August 3, 2026 20:34
# Conflicts:
#	datafusion/physical-plan/src/aggregates/hash_stream.rs
# Conflicts:
#	datafusion/physical-plan/src/aggregates/hash_stream.rs
@github-actions github-actions Bot added the auto detected api change Auto detected API change label Sep 1, 2026
@github-actions github-actions Bot removed the auto detected api change Auto detected API change label Sep 2, 2026
@rluvaton
rluvaton marked this pull request as ready for review September 2, 2026 09:29
/// States for final hash aggregation processing.
// The typestate pattern is used in case the inner logic becomes more complex in
// the future.
enum FinalHashAggregateState {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to keep the explicit states, and only use the emitter pattern to get rid of the verbose control flow implementation?

If we measure complexity as the cognitive load to understand everything, instead of LoC, I think this explicit state representation approach is better.

As I currently understand it, the heuristic to follow is:

Additionally, I didn't try to polish the state splits originally, so there might be some room to simplify them, like merging sibling states to make it less verbose.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment kept for high level understanding, I did not measure by LoC but by cognitive load, with the async generators it is much easier for me understand the code, and the flow is clearer.

Anyway, I extracted the final hash aggregate to a separate pr with updated comments

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting... I feel the opposite way.

If we don't encode the states explicitly, then the states/transitions have to be encoded with local variables and hidden assumptions, and to understand that we have to load everything into short-term memory, which is hard.

The benefit of an explicit state representation is that it's a 1:1 mapping from the mental model to the code:

  1. It's possible to understand each state separately
  2. It's safer: impossible states are unrepresentable, and it's easy to guard with sanity checks

It's quite understandable for me now, because I'm already familiar with it; for someone without prior knowledge trying to understand it, or if it later evolves into a different shape, I think it will be more challenging to understand.

@rluvaton rluvaton Sep 2, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the state machine is unneded since it is almost linear with async generators for the final stream

you read from input, if you dont have memory, spill and continue reading
once finished, if have spills, spill the in pending data in hash table and switch to ordered final aggregate stream
if no spills, just output batches from hash table.

Flow image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the state machine is unneded since it is almost linear with async generators for the final stream

This point makes sense to me. If we can model the state graph to a linear (no backwards edge) shape, maybe it's good to eliminate enum states.

I'd like to do some prototyping myself to figure out the pattern.

@jayzhan211 jayzhan211 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@2010YOUY01

Copy link
Copy Markdown
Contributor

#24877 tries to apply generator pattern together with explicit states, I'm wondering how you guys think.

I'm lean towards keeping the explicit states, because it's more like controlling complexity with a mechanism instead of with discipline.

It's also a pattern that can be used brainlessly for more complex state graphs, like joins with spilling (lots of loop edges), and we don't have to invent different patterns for different operators for consistency.

I think this PR is pretty clean now, and the quality is maintained by good practice. However, if we don't rely on explicit states, I think it's more likely to get poisoned in the future (e.g. adding mysterious local flags for new features, making it confusing again).

# Conflicts:
#	datafusion/physical-plan/src/aggregates/hash_stream.rs
@rluvaton rluvaton changed the title chore: convert PartialHashAggregateStream and FinalHashAggregateStream to async generators and cleanup chore: convert PartialHashAggregateStream to async generators and cleanup Sep 2, 2026
@rluvaton

rluvaton commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

@2010YOUY01 I've cleaned up and add something like state machine, can you please take another look

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

Labels

physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants