Uh oh!
There was an error while loading. Please reload this page.
fix: output_bytes metric in hash aggregation - #23777
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #23777 +/- ##
==========================================
- Coverage 81.29% 81.14% -0.15%
==========================================
Files 1110 1110 Lines 385197 386141 +944 Branches 385197 386141 +944 ==========================================
+ Hits 313132 313342 +210 - Misses 53588 54332 +744 + Partials 18477 18467 -10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Jithendra2608
commented
Jul 22, 2026
Hi @ariel-miculas! I was taking a look at the failing CI checks to see if I could help unblock this. Fixing that one word should turn the CI green. Hope this helps, and great work on the hash aggregation metrics! |
ariel-miculas
commented
Jul 22, 2026
@2010YOUY01 coud you please take a look? |
2010YOUY01
commented
Jul 26, 2026
Is it possible to implement it entirely within the Also let's add some end-to-end tests, ideally we can do it with |
ab748ff to
8995ed6Compareariel-miculas
commented
Aug 5, 2026
I don't see how, since
Added an |
ariel-miculas
commented
Aug 5, 2026
Closed and reopen to see if the test failure in an unrelated ordered_aggregate_spill.slt is transient: |
ariel-miculas
commented
Aug 6, 2026
@2010YOUY01 let me know what you think |
2010YOUY01
commented
Aug 6, 2026
Perhaps we can use something like |
ariel-miculas
commented
Aug 6, 2026
That's kind of what I'm doing, except I've wrapped Unless I've missed something from your explanation. |
ariel-miculas
commented
Aug 6, 2026
Or you mean changing |
2010YOUY01
commented
Aug 6, 2026
Yes, exactly. Even if it's only for aggregation, I think this approach is still overall simpler. The existing approach seems to leak some complexity into the aggregation logic. Also, the memory overcounting in the metrics is also likely in other operators, since now we're using batch concatenation quite commonly in joins/window executions. |
8995ed6 to
17a8e86Compareariel-miculas
commented
Aug 12, 2026
Implemented the proposed approach, indeed it looks simpler overall. |
2010YOUY01
commented
Aug 13, 2026
Thank you, the implementation looks good to me. There is a related inefficiency that was reported recently. I'll try to look into it soon and then figure out how we should proceed with this PR. Even if we can't eliminate the extra overhead, we can still add a config option to enable or disable this hash-set-based deduplication, this shouldn't be a hard blocker. |
Instead of a config option, could we use a flag that gets set by select operators, such as hash aggregate? Because for hash aggregate we already know that sliced RecordBatches will be produced from a huge initial RecordBatch.
With the config option my concern is that we'd be trading correctness for performance, since without the deduplication the hash aggregation shows heavily inflated output_bytes metrics. |
2010YOUY01
commented
Aug 14, 2026
Yes, I think starting with only aggregate is a good idea
I agree. That also adds extra complexity. I imagine the performance impact would be minimal, since a hash set whose size is proportional to the number of batches is much smaller than the actual workload. We just need to verify that in #24310 |
Which issue does this PR close?
Rationale for this change
Summing together the produced sliced RecordBatches in hash aggregation leads to inflated output_bytes metric
What changes are included in this PR?
Are these changes tested?
Yes
Are there any user-facing changes?
If the metrics are user-facing, then yes.