feat: build SQL materializations from Planner selection - #623
Merged
Merged
Conversation
…contract' into feat/clickhouse-table-population
…auto-materialization
zzylol
marked this pull request as ready for review
September 11, 2026 00:57
…use-automatic-publication
zzylol
changed the base branch from
feat/clickhouse-auto-materialization
to
main
September 11, 2026 01:10
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.
Construct SQL materializations from the actual selected Planner DAG instead of requiring callers to predeclare a winning family and catalog. The automatic publication endpoint accepts SQL, schemas, accuracy, and a plan envelope; it derives supported materializations, retains semantic bindings, and uses the existing atomic install/activate path.
The real mixed-process regression now plans and constructs its state automatically, backfills the filtered ClickHouse population, and combines summary readout with an exact branch. It records the candidate ranking and selected flag from that same search. Missing numeric cost estimates remain explicitly unavailable.
This also fixes two inherited emitter assumptions: backend windows retain their selected duration rather than the legacy edge 5–60 s clamp, and SQL raw input does not acquire PromQL right-closed range semantics. Family/config conversion no longer serializes through an intermediate JSON string.
Validation: 720 control-plane library tests pass; the control-plane binary checks successfully. The real automatic ClickHouse process regression passes (1.42 s), matching the pre-mutation exact result after the source changes. Candidate/publication evidence is saved by CLICKHOUSE_PLANNING_ARTIFACT.
Initial scope is whole-second fixed windows and scalar column reductions; two retained windows cover the completed/active pair. This is not cost-optimized lifecycle selection or complete o11y workload acceleration. Grouped/complex schemas, literal count updates, and boundary fragments remain follow-ups. No performance claim.
Stacked on #618.