Skip to content

feat(sql): lower typed Struct field access - #399

Merged
zzylol merged 7 commits into
mainfrom
feat/sql-struct-field-access
Sep 11, 2026
Merged

zzylol merged 7 commits into
mainfrom
feat/sql-struct-field-access

Conversation

@zzylol

@zzylol zzylol commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

ClickHouse tupleElement could not reach the existing typed Struct-field expression. This adds a planning adapter that delegates field selection to the shared resolver and exports asap_struct_field; it does not add another Tuple type or scalar return-type policy.

Before, selecting a declared Struct field was unsupported. After, tupleElement(sample, 1) and tupleElement(sample, 'value') retain the selected field's type and nullability. Dynamic, missing, and unsupported ordinal selectors fail closed. A private adapter dispatch distinguishes Map, element lookup, and Struct-field lookup while all semantic rules remain shared.

Verification: all frontend SQL tests passed, including 93 lowering tests, ordinal/name selection, nullable fields, invalid selectors, and the existing original o11y Map queries. Physical execution remains the backend's responsibility and requires its matching Struct consumer. Numeric x.1 syntax, lambdas, and full counter-query acceleration are not implemented by this change. No performance claim.

@zzylol
zzylol changed the base branch from feat/sql-element-access to main September 11, 2026 15:40
@zzylol
zzylol marked this pull request as ready for review September 11, 2026 15:42
@zzylol
zzylol merged commit 411ea54 into main Sep 11, 2026
5 of 8 checks 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