Add aggregate-specific metrics to legacy grouped hash and TopK - #24523
Draft
kosiew wants to merge 3 commits into
Draft
Add aggregate-specific metrics to legacy grouped hash and TopK#24523kosiew wants to merge 3 commits into
kosiew wants to merge 3 commits into
Conversation
… TopK paths - Legacy grouped hash: per-aggregate update/merge/state/convert/evaluate timers. - Reused canonical phase contract; spill-safe Single merge coverage. - Grouped TopK: per-aggregate argument timer; accumulator phases documented N/A. - Tests: legacy fallback labels/times; TopK metric label/time.
…ssing &batch directly
- Final metrics test now checks migrated + legacy paths. - TopK test now asserts bounded MIN output + metric.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24523 +/- ##
========================================
Coverage 81.30% 81.31%
========================================
Files 1117 1117
Lines 395798 396065 +267
Branches 395798 396065 +267
========================================
+ Hits 321815 322049 +234
- Misses 55164 55187 +23
- Partials 18819 18829 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
Aggregate-specific timing metrics should remain consistent across grouped aggregation implementations. Previously, queries using the legacy grouped hash or grouped TopK paths could expose less per-aggregate timing information than queries using the migrated grouped hash implementation, making metrics dependent on which internal aggregation path was selected.
This change extends aggregate-specific metrics to those remaining paths for the phases they actually perform.
What changes are included in this PR?
GroupedHashAggregateStreamfor update, merge, state, evaluate, and convert-to-state phases.GroupedTopKAggregateStream.datafusion.execution.enable_migration_aggregate.Are these changes tested?
Yes.
The patch adds
test_legacy_groupby_aggregate_accumulator_metrics, which disablesdatafusion.execution.enable_migration_aggregateand verifies aggregate-specificarguments_time,update_time, andstate_timemetrics for the legacy grouped hash path, including positive update and state timings.test_groupby_metrics_final_modenow exercises final-mode metrics withdatafusion.execution.enable_migration_aggregateset to bothtrueandfalse.The patch also adds
test_topk_aggregate_argument_metrics, which exercises grouped TopK aggregation and verifies that the per-aggregateagg_expr_0_arguments_timemetric is present, labeled withMIN(a), and non-zero.Are there any user-facing changes?
Yes. Query execution metrics now expose more consistent aggregate-specific timing information when grouped aggregation uses the legacy grouped hash or grouped TopK implementations.
There are no public API changes.
LLM-generated code disclosure
This PR includes LLM-generated code and comments. All LLM-generated content has been manually reviewed.