Conversation
Contributor
Author
|
Closing as superseded by the unified ClickHouse path merged through #589 and its prerequisite stack. This branch retains the older independent plan-catalog/sidecar architecture and should not be merged into current main. |
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.
Why
ClickHouse requests could proxy and execute hand-built summary DAGs, but planner-produced SQL with relational roots never reached recursive summary selection. The observability SQL corpus also used ClickHouse-specific exact SQL that the canonical frontend could not parse, and ratio queries had no read-time relational join over two selected summaries.
What
planning_sqlowned by the ClickHouse workload sidecar.asap_rate/asap_increaseplans to existing SDS materializations without changing the PromQL binder or SDS descriptor meanings.lastsemantics fail-closed and documents why existing MinMax/Increase state cannot be reused safely.How
The control plane parses only
planning_sqland publishes the original exact SQL as the strict runtime identity and fallback template. The data plane looks up that exact template without reparsing ClickHouse-only tuple/map/lambda syntax. RelationalJoin recursively executes its two reachable summary DAGs, checks each leaf against its own pane window and origin, joins rows on the reviewed cross-input equality predicate, and applies the existing relational projection.Before this PR
SELECT labels, max(value) ... ORDER BY labelsstopped at root-only candidate selection, while expanded rate and ratio SQL stopped in the SQL frontend. No control-plane artifact had been proven through publication, backfill, SummaryStore, and the ClickHouse HTTP warm path.After this PR
A bounded grouped max query compiles, publishes, backfills from a real ClickHouse server, and returns a typed warm result equal to native ClickHouse. Planner-friendly rate/increase SQL compiles into existing exact counter summaries with strict series-identity proof. A two-rate ratio compiles into two SDS bindings plus RelationalJoin and returns
0.2from real SummaryStore panes; a missing pane on either input routes to exact fallback.Verification
cargo test -p control_plane clickhouse --lib— 6/6 passed.cargo test -p data_plane asap_clickhouse_query_engine --lib— 15/15 passed.cargo test -p data_plane --test clickhouse_ratio_store_e2e -- --nocapture— passed, including unequal pane windows and one-side coverage failure.CLICKHOUSE_URL=http://127.0.0.1:18123 CLICKHOUSE_USER=bench CLICKHOUSE_PASSWORD=bench cargo test -p data_plane --test clickhouse_q05_process_e2e -- --nocapture— passed against real ClickHouse; assertedx-asap-execution=warmand differential equality.cargo check --all-targets -q— passed.cargo fmt -p control_plane -p data_plane -- --checkandgit diff --check— passed.Limitations
Planning SQL functions are a control-plane contract; the exact SQL remains the ClickHouse-executable fallback.
asap_last, temporal grids/subqueries, and histogram quantile remain typed fallback until they can be implemented without changing existing shared SDS semantics. This PR depends on ASAPPlanner PRs #369 and #370.Human review — do not complete with an agent