feat(clickhouse): execute typed Map scalar expressions - #646
Merged
Merged
Conversation
zzylol
changed the base branch from
feat/clickhouse-map-transport
to
eval/original-o11y-sql-execution
September 11, 2026 13:24
zzylol
changed the base branch from
eval/original-o11y-sql-execution
to
main
September 11, 2026 13:32
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.
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.