Skip to content

feat(clickhouse): execute typed Map scalar expressions - #646

Merged
zzylol merged 5 commits into
mainfrom
feat/clickhouse-map-scalars
Sep 11, 2026
Merged

zzylol merged 5 commits into
mainfrom
feat/clickhouse-map-scalars

Conversation

@zzylol

@zzylol zzylol commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

SQL Map projections need executable scalar semantics after Planner has preserved their types; a typed schema alone cannot evaluate missing keys or duplicate entries correctly.

This adds Map construction, ordered concatenation, and first-match lookup to the existing ClickHouse relational evaluator. Before this PR these scalar calls failed locally; after it a shared QueryPlan projection can combine Map values while obtaining missing-key defaults from the canonical Planner scalar type contract. Empty maps and nullable values remain distinct. Integer arithmetic, including modulo above 2^53, retains Int64 values instead of rounding through Float64.

The implementation reuses the existing ordered Map cell representation and Planner signature resolver. Null-only types have Arrow representation; List/Struct value transport remains explicitly unsupported. No new query-specific plan structure or raw sample store is introduced.

Verification: all 9 relational-adapter tests pass against the pinned sketchlib #139 checkout, including duplicate keys, empty/nullable lookup, incompatible numeric map types, integer modulo overflow/zero-divisor cases, exact mixed integer/float comparison, and rejection of nested NaN sort keys. End-to-end original SQL coverage is pending the Planner AST adapter; this PR makes no new workload acceleration claim. Visual evidence is not applicable.

Dependencies: #641/#642 and Planner #393 are merged. The current pin is reviewed Planner #394 commit b2b0562. Original 27-query publication still has only three installable queries: additional parsed queries expose unsupported exact-subtree rendering and nested materialization binding. Keep draft while the actual process replay and Planner dependency CI finish.

@zzylol
zzylol changed the base branch from feat/clickhouse-map-transport to eval/original-o11y-sql-execution September 11, 2026 13:24
@zzylol
zzylol changed the base branch from eval/original-o11y-sql-execution to main September 11, 2026 13:32
@zzylol
zzylol marked this pull request as ready for review September 11, 2026 14:09
@zzylol
zzylol merged commit d059e17 into main Sep 11, 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