fix(enums): close AggregationType match gaps for CountSketch[WithHeap] - #262
Merged
Merged
Conversation
Audit follow-up from PR #258 — the new `CountSketchWithHeap` enum variant exposed two pre-existing panic / capability-miss paths that needed parallel arms: - `does_precompute_operator_support_subpopulations` (logics.rs): the catch-all `_ => panic!(...)` would fire for both `AggregationType::CountSketch` and `CountSketchWithHeap` if callers ever routed those through. Added explicit Sum/Count arms for CountSketch (mirrors the CMS arm — signed-counter equivalent) and a Topk arm for the heap-bearing variant (returns false, parallel to `CountMinSketchWithHeap`). - `compatible_agg_types(Statistic::Topk)` (capability_matching.rs): the list previously named `CountMinSketchWithHeap` and bare `CountSketch` but omitted `CountSketchWithHeap` — capability misses on a heap-bearing CountSketch policy would route the Topk query past the warm engine. Added the third entry. Test coverage in `test_does_precompute_operator_support_subpopulations` extended to assert no-panic for both new variants on their canonical statistics. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Audit follow-up from PR #258 — the new
CountSketchWithHeapenum variant exposed two pre-existing panic / capability-miss paths that needed parallel arms.Two fixes
does_precompute_operator_support_subpopulations(promql_utilities/src/query_logics/logics.rs): the catch-all_ => panic!(...)would fire for bothAggregationType::CountSketchandCountSketchWithHeapif any caller routed them through. Added explicit arms — CountSketch mirrors the CMS Sum/Count shape (signed-counter equivalent), and CountSketchWithHeap mirrors CountMinSketchWithHeap on Topk.compatible_agg_types(Statistic::Topk)(asap_types/src/capability_matching.rs): the list namedCountMinSketchWithHeapand bareCountSketchbut omittedCountSketchWithHeap— capability misses on a heap-bearing CountSketch policy would route the Topk query past the warm engine.Test plan
cargo test --workspace --lib— 1549 pass, 0 failtest_does_precompute_operator_support_subpopulationsextended with no-panic assertions for both new variants🤖 Generated with Claude Code