docs(design): controller mapping from query to edge aggregation config (scope + sparse) - #26
Closed
zzylol wants to merge 1 commit into
Closed
docs(design): controller mapping from query to edge aggregation config (scope + sparse)#26zzylol wants to merge 1 commit into
zzylol wants to merge 1 commit into
Conversation
Specify how the controller lowers a query into the per-aggregation edge decisions: sketch family+params (L4 binding rule), aggregation SCOPE (per-series vs whole-stream, driven by Aggregate.by + the TimeRange per-series marker), and sparse-vs-dense HLL, then emits PrecomputeConfig. Grounds each decision in the existing L3 intent algebra (AggIntent, GroupKeys, AccuracyTarget) and L4 sketch IR (SummaryKind/SummaryParams), and identifies the two not-yet-built layers (optimizer/rules binding + deployment-model emitter) where the mapping should live. Closes the controller follow-up flagged by ASAPCollector #471 (Scope) and #472 (hll_sparse). Design only; no code. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Misplaced — the query→edge-config mapping belongs in ASAPQuery-backend's control_plane (which already has intent_algebra/, optimizer/, and emit/precompute.rs), not the controller. Moving the design + implementation there. |
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.
What
Design doc specifying the controller-side mapping from query → edge aggregation config — the follow-up flagged by ASAPCollector #471 (the
Scopeper-series/whole-stream field) and #472 (thehll_sparseknob). Those edge fields exist but currently default to legacy behavior because nothing on the controller sets them; this doc specifies the mapping that does.New file:
docs/query-to-edge-config-mapping.md.Scope of the design
Three per-aggregation decisions, each grounded in code that already exists:
AggIntentkind +AccuracyTargetagg_intent.rs:35,types.rs:5Aggregate.by: GroupKeys+ theTimeRangeper-series markerquery_expr.rs:47,278,369Cardinalityintent + expected cardinality + εagg_intent.rs(+ workload/catalog)Key rules:
by.is_empty()and not per-series) ⇒WholeStream; grouped (bynon-empty) ⇒PerSerieswithAggregateBy = by;Rate/IncreaseorTimeRange-child ⇒PerSeries. (Grouped ≠ whole-stream:sum by (zone)needs one sketch per zone.)ItemLabelreconciled with whole-stream item-subject (distinct items vs value distribution).What it identifies as the gap
The L3 intent algebra and L4 sketch-bound IR (
SummaryKind/SummaryParams) exist, but the L3→L4 binding rules (optimizer/rules/) and the L4→edge emitter that producesPrecomputeConfigdo not — both are future work perdocs/design.md. The doc specifies them as pure, table-testable mapping functions, includes worked examples (PromQL/SQL → config),AggIDstability/versioning, a build order, and open questions (expected-cardinality source, DDSketch-vs-KLL, Theta/KMV with no edge family).Design only — no code.
🤖 Generated with Claude Code