Fix parsing of named Tuple elements - #964
Open
sidsri14 wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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
ParsedColumnTupleoutput 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. |
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.
Summary
Fixes #891 by accepting optional bare or quoted element names in the deprecated tuple column-type parser while preserving its existing
ParsedColumnTupleoutput shape.Checklist
CHANGELOG.mdTesting
npm exec -- vitest run <all parse_column_types unit files>(39 tests)npm --prefix packages/client-common run typechecknpm --prefix packages/client-common run lint