Skip to content

Fix parsing of named Tuple elements - #964

Open
sidsri14 wants to merge 3 commits into
ClickHouse:mainfrom
sidsri14:sidsri14/fix-named-tuple-types
Open

Fix parsing of named Tuple elements#964
sidsri14 wants to merge 3 commits into
ClickHouse:mainfrom
sidsri14:sidsri14/fix-named-tuple-types

Conversation

@sidsri14

@sidsri14 sidsri14 commented Jul 24, 2026

Copy link
Copy Markdown

Summary

Fixes #891 by accepting optional bare or quoted element names in the deprecated tuple column-type parser while preserving its existing ParsedColumnTuple output shape.

Checklist

  • Unit tests covering the common scenarios were added
  • A human-readable changelog entry was added to every affected package's CHANGELOG.md

Testing

  • npm exec -- vitest run <all parse_column_types unit files> (39 tests)
  • npm --prefix packages/client-common run typecheck
  • npm --prefix packages/client-common run lint
  • official Node unit config (403 passed, 10 skipped)
  • client-common, client-node, client-web, and datatype-parser workspace typechecks

Copilot AI review requested due to automatic review settings July 24, 2026 13:32
@CLAassistant

CLAassistant commented Jul 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes parsing of ClickHouse named Tuple element syntax in the deprecated parseColumnType / parseTupleType string parser, aligning it with the type strings returned by DESCRIBE TABLE and RowBinary/Native headers.

Changes:

  • Updated tuple parsing to accept optional element names (bare, backtick-quoted, or double-quoted) while keeping the existing ParsedColumnTuple output shape.
  • Added a dedicated tuple-element parsing helper and a regex to strip element names when needed.
  • Added unit tests covering named tuple elements (including quoted names).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/client-common/src/parse/column_types.ts Parse tuple elements via a helper that can strip optional element names before recursively parsing the element type.
packages/client-common/tests/unit/parse_column_types_tuple.test.ts Adds unit coverage for named tuple element forms, including quoted identifiers.

Comment thread packages/client-common/src/parse/column_types.ts
Comment thread packages/client-common/src/parse/column_types.ts Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 13:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread packages/client-node/CHANGELOG.md
Comment thread packages/client-web/CHANGELOG.md
Copilot AI review requested due to automatic review settings July 25, 2026 09:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@sidsri14
sidsri14 marked this pull request as ready for review July 27, 2026 13:12
@mshustov
mshustov requested a review from Copilot August 4, 2026 19:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

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.

parseColumnType throws on named Tuple types (Tuple(name Type, ...))

3 participants