Skip to content

feat(clickhouse): execute typed exact leaves in shared DAG - #589

Merged
zzylol merged 1 commit into
mainfrom
feat/unified-clickhouse-exact-leaves
Sep 10, 2026
Merged

zzylol merged 1 commit into
mainfrom
feat/unified-clickhouse-exact-leaves

Conversation

@zzylol

@zzylol zzylol commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Why

A planner-selected SQL plan can contain one summary-backed branch and one exact ClickHouse branch. The shared query DAG already represented that boundary as ExternalExact, but the ClickHouse runtime could not fetch its typed relation or compose it with summary readouts.

What

  • Bind an explicit planner fallback cut to the language-neutral ExternalExact node.
  • Fetch ClickHouse exact leaves before synchronous DAG evaluation.
  • Decode typed JSONCompact relations, including timezone-qualified timestamps.
  • Join and project exact rows with SummaryStore readouts in the existing QueryPlan DAG.

How

The control plane publishes SQL, output schema, parameters, and evaluation-range parameter names on ExternalExactRequest. The data plane forwards each ClickHouse leaf to the configured exact backend, validates response metadata against the planned schema, and supplies the typed relation to the ordinary relational executor. Summary coverage validation remains per materialization leaf.

Before this PR

A mixed plan reached ExactFallback; only all-summary relational DAGs could execute locally.

After this PR

One installed DAG can read SummaryStore state, execute a typed exact SQL leaf in ClickHouse, join both relations, and apply the remaining projection. No ClickHouse-specific catalog, sidecar plan, or alternate executor is introduced.

Verification

  • cargo fmt --all -- --check
  • cargo check -p control_plane -p data_plane --lib -j 1
  • cargo test -p data_plane asap_clickhouse_query_engine::accelerator::tests --lib -j 1 — 4 passed
  • Mixed SummaryStore + external ClickHouse leaf join/project test verifies 0.5 result and evaluation-range parameters.

Limitations

The control plane must still choose and bind the explicit exact cut. A live ClickHouse differential run and the full 27-query workload report remain follow-up validation.

@zzylol
zzylol force-pushed the feat/unified-clickhouse-exact-leaves branch from fa73c1b to 73b440a Compare September 10, 2026 18:57
@zzylol
zzylol merged commit 699a8e0 into main Sep 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant