Skip to content

feat(parser): ClickHouse array/tuple element access via dot (d.1) - #535

Open
basili4-1982 wants to merge 1 commit into
ajitpratap0:mainfrom
basili4-1982:feat/clickhouse-array-dot
Open

feat(parser): ClickHouse array/tuple element access via dot (d.1)#535
basili4-1982 wants to merge 1 commit into
ajitpratap0:mainfrom
basili4-1982:feat/clickhouse-array-dot

Conversation

@basili4-1982

Copy link
Copy Markdown

Summary

ClickHouse allows array/tuple element access with dot-notation (d.1, tuple.2)
inside expressions. The parser rejected a numeric component after a period with
E2004 (expected column name or * after table qualifier).

Changes

  • pkg/sql/parser/expressions_literal.go: allow a numeric component after .
    in qualified identifiers when the dialect is ClickHouse (guarded, so Postgres
    qualified columns schema.123 stay unchanged).
  • pkg/sql/parser/clickhouse_array_dot_test.go: regression round-trip tests.

Test plan

  • TestClickHouseArrayElementAccess (d.1, a.x, arr[1]) — green
  • go test -short ./pkg/sql/ast/ ./pkg/sql/parser/ ./pkg/gosqlx/ ./pkg/formatter/ green

Allow a numeric component after a period in ClickHouse qualified identifiers
(alias.1, tuple.2) for array/tuple element access. Restricted to the ClickHouse
dialect so Postgres qualified columns stay unchanged.

Regression: TestClickHouseArrayElementAccess.
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

@basili4-1982 is attempting to deploy a commit to the coolajitpratapsingh0-9932's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant