Skip to content

Write full type names in block headers - #34

Merged
serprex merged 1 commit into
ClickHouse:mainfrom
iliaal:ch-long-type-names
Nov 22, 2026
Merged

serprex merged 1 commit into
ClickHouse:mainfrom
iliaal:ch-long-type-names

Conversation

@iliaal

@iliaal iliaal commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

chc_block_write_cols copies each column's type name into a 256-byte stack buffer and returns CHC_ERR_USAGE ("type name too long for inline buffer") when the name doesn't fit. A valid type longer than 255 bytes can't be sent. For example, an INSERT block for Enum16('label_00' = 1, ..., 'label_39' = 40) fails before any byte is written. Wide Enums, named Tuples and deep nesting reach that length easily.

The column's parsed type already stores its full spelling, so the writer now sends that through chc_type_name().

test_write_long_enum round-trips that Enum16 through clickhouse local. test_block_write_rejects asserted the old rejection, so it is removed.

chc_block_write_cols staged each column's type name in a 256 byte stack
buffer & failed with "type name too long for inline buffer" past 255
bytes, so a block carrying a wide Enum or a deeply nested type could not
be sent. Write the parsed type's stored spelling directly.
@serprex

serprex commented Nov 22, 2026

Copy link
Copy Markdown
Member

very nice

@serprex
serprex merged commit 265c27a into ClickHouse:main Nov 22, 2026
1 check passed
@serprex serprex mentioned this pull request Nov 22, 2026
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.

2 participants