feat(clickhouse): execute typed array element access - #653
Merged
Merged
Conversation
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.
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_accessnode, 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.