Skip to content

feat(clickhouse): execute typed array element access - #653

Merged
zzylol merged 5 commits into
mainfrom
feat/clickhouse-collection-values
Sep 11, 2026
Merged

zzylol merged 5 commits into
mainfrom
feat/clickhouse-collection-values

Conversation

@zzylol

@zzylol zzylol commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

ClickHouse exact branches can return typed arrays, but the backend currently rejects those values before a parent scalar operator can read an element. This change decodes declared Array elements into shared internal storage and executes the canonical asap_element_access node, preserving existing Map lookup behavior.

List lookup uses signed one-based indices, returns the element type’s default for missing positions, and propagates a NULL index separately from element nullability. Branch copies share the array through Arc; unsupported collection sorting fails explicitly. The exact SQL renderer recognizes the same canonical function.

Internal exact requests quote non-finite numbers so NaN/Inf cannot silently become NULL; unsupported non-finite values take the existing fallback path.

Validation: all 29 applicable ClickHouse tests and 5 exact-renderer tests pass in the combined collection consumer stack (31 and 6 tests total). Data-plane tests use sketchlib #139 with a matching Collector dependency. Native ClickHouse JSONCompact probes confirm array nullability and integer-preserving transport. Depends on Planner #397, pinned at 5e939603.

This is an internal scalar-execution capability, not a new workload acceleration result. Direct List/Struct output, Tuple transport, and lambda execution remain unsupported. Literal zero indices remain conservatively rejected by the shared contract; dynamic zero uses the native default behavior.

@zzylol
zzylol marked this pull request as ready for review September 11, 2026 15:20
@zzylol
zzylol merged commit 624e450 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