feat(summary_executor): read out named-key PointCount (count(metric{item=x})) - #414
Merged
Merged
Conversation
zzylol
force-pushed
the
feat/control-plane-frequency-extension-realize
branch
from
July 27, 2026 12:36
f6f34db to
e697463
Compare
…tem=x}))
Bumps the ASAPController rev pin to e4cea66 (feat/extension-realization-hook,
ASAPController#162, not yet merged) to pick up
SketchQuery::PointCount.value: Option<String>.
Adds SummaryState::estimate(key) in delta_apply.rs, mirroring topk_items's
per-variant dispatch but broader: all four Frequency variants (Cms,
CountSketch, CmsWithHeap, CountSketchWithHeap) already carry a keyed
estimate over their matrix -- no heap needed, unlike TopK.
summary_executor.rs's sketch_query_value now handles PointCount{key:
SampleValue, value: None} (bare total, unchanged) and PointCount{key:
Named/Qualified, value: Some(v)} (per-item point lookup via
SummaryState::estimate), erroring on any other key/value combination
instead of guessing.
This closes the data_plane side of the named-key PointCount gap
(Phase 4 of 5). Threading the actual filter value into the query
pipeline that constructs SketchQuery::PointCount (Phase 3) turned out to
require substantially more plumbing than expected -- a new
metric-to-item_label lookup mechanism through a previously pure-syntax
PromQL parsing pipeline -- and is deferred as a separate, larger task;
this PR's new tests exercise the readout logic directly with hand-built
SketchQuery::PointCount{value: Some(_)} fixtures rather than an
end-to-end PromQL string.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
zzylol
changed the base branch from
feat/control-plane-frequency-extension-realize
to
main
July 27, 2026 12:41
zzylol
force-pushed
the
feat/summary-executor-pointcount-readout
branch
from
July 27, 2026 12:41
d7a78a8 to
dcc0af6
Compare
5 tasks
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
Phase 4 of 5 toward supporting named-key
SketchQuery::PointCount(count(cms_metric{item="x"})). NeedsSketchQuery::PointCount.valuefrom ASAPController#162 (merged) / #413 (merged) — both landed, so this is now based directly onmain.data_plane's ASAPController rev pin to the merged64df20d(matching feat(sketch_algebra): realize Frequency (AggIntent::Extension) as a real Cms sketch #413's control_plane pin) to pick upSketchQuery::PointCount.value: Option<String>.SummaryState::estimate(key)indelta_apply.rs, mirroringtopk_items's per-variant dispatch pattern but broader: all four Frequency variants (Cms,CountSketch,CmsWithHeap,CountSketchWithHeap) already carry a keyedestimateover their matrix — no heap needed for a point lookup, unlikeTopK.sketch_query_value'sPointCountarms now handle both shapes:{key: SampleValue, value: None}(bare total, unchanged behavior) and{key: Named/Qualified, value: Some(v)}(per-item point lookup viaSummaryState::estimate), erroring on any other key/value combination rather than guessing.Scope note: this closes the
data_plane-side readout logic only. Threading the actual filter value into whatever constructsSketchQuery::PointCountin the first place (Phase 3 —control_plane'sfrequency()intent construction) turned out to need substantially more plumbing than expected: recognizing a barecount(metric{item="x"})PromQL shape and resolvingitemagainst a metric's configured item-label requires a new metric→item_label lookup mechanism threaded throughparse_query_expr_canonical(18 call sites) andQueryWorkload(31 struct-literal construction sites, noDefaultimpl) — a genuinely larger, separate task, deferred for now. This PR's new tests exercise the readout logic directly with hand-builtSketchQuery::PointCount{value: Some(_)}fixtures instead of an end-to-end PromQL string, which is exactly the shape Phase 3 will eventually produce.Test plan
cargo test -p data_plane --lib summary_executor— 17 tests (15 existing + 2 new), all passing:single_cms_sid_named_key_point_estimate— a single sid, point lookup for a specific key, asserts the exact inserted weight.two_cms_sids_same_group_named_key_estimate_merges_cross_sid— two sids contributing to the same key, proves the merged answer is the sum (the cross-sid merge proof, mirroringtwo_cms_sids_same_group_totals_actually_merge).cargo test -p data_plane --lib— full lib suite: 913 passed, 2 ignored.cargo test -p data_plane --test e2e_controller_plans_and_backend_serves— 2 pre-existing failures (controller_plan_to_query_full_roundtrip_{cms,count_sketch}_with_heap_topk), confirmed identical on the unmodified branch viagit stashbefore/after comparison — not a regression from this change.cargo build --workspace— clean.cargo clippy -p data_plane --lib --tests— 107 warnings, same count as this branch's baseline; verified none fall in the touched files.rustfmtscoped to the two touched files.🤖 Generated with Claude Code