Repository navigation
perf: compact inputs for grouped aggregate filter - #24869
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24869 +/- ##
========================================
Coverage 81.74% 81.74%
========================================
Files 1128 1128
Lines 416644 416803 +159
Branches 416644 416803 +159
========================================
+ Hits 340592 340736 +144
Misses 55995 55995
- Partials 20057 20072 +15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
||
| # Each aggregate must compact group indices using its own FILTER. Cover both | ||
| # primitive and boolean group accumulators, including groups rejected by both. | ||
| query IIB |
There was a problem hiding this comment.
Could we add a SQL-level test where the FILTER predicate contains NULL values, ideally with a fallible aggregate argument? The helper unit test covers NULLs in the bitmap, but the new true_count -> filter_record_batch path is not covered end to end. I think a test here would be useful to verify that NULL is treated as not selected and that the compacted group IDs stay aligned with the aggregate arguments.
There was a problem hiding this comment.
Thanks for the suggestion! I've added an SLT covering NULL filter predicates with a fallible aggregate argument and interleaved groups to verify that compacted group IDs stay aligned.
|
🚀 |
Which issue does this PR close?
Rationale for this change
Grouped aggregate
FILTERcurrently scatters evaluated arguments back to their original row positions. The accumulator then receives the full-length arguments and group IDs and scans the filter again. This introduces unnecessary scatter and filtering work.What changes are included in this PR?
PartialandSingleaggregation, evaluate aggregate arguments using only rows selected by the filter.What is the testing strategy for this PR?
Yes. slts cover independent filters, rejected groups, primitive and boolean group accumulators, ordered-input scenarios, and skip-partial aggregation. Unit tests cover group ID compaction and row-aligned skip-partial state conversion.
Are there any user-facing changes?
No. This is an internal performance optimization.
Benchmark