Skip to content

Support ZSTD-compressed server responses - #43

Merged
quinnj merged 1 commit into
masterfrom
maintenance/clickhouse-reply-compression
Oct 3, 2026
Merged

quinnj merged 1 commit into
masterfrom
maintenance/clickhouse-reply-compression

Conversation

@quinnj

@quinnj quinnj commented Oct 3, 2026

Copy link
Copy Markdown
Member

Connections with LZ4 or checksum-only transport fail when a ClickHouse server returns ZSTD blocks: reading method byte 0x90 throws before the response can be decoded. Decode that method with CodecZstd, and support ClickHouse.COMPRESSION_ZSTD for outgoing blocks. The server can keep choosing its reply format, including for users whose read-only sessions forbid changing settings.

Add codec fixtures, full query coverage for checksum-only and ZSTD connections, and read-only queries in every mode. Add CI on Julia 1.6/current with ClickHouse 22.8/26.9. Remove five redundant type annotations on UInt64 hash constants so the package can load on Julia 1.6; the hexadecimal constants retain their existing types and values.

Validation: reproduced the original failure on stock ClickHouse 26.9.9.28 (uncompressed passes; LZ4 and checksum-only error). The complete suite passes locally on Julia 1.6.7 with ClickHouse 22.8.21.38 and 26.9.9.28, and on Julia 1.12.6 with 26.9.9.28. Each final run includes 112 live database checks across four modes, eight read-only checks, existing hash fixtures, and captured native-protocol packet tests.

Fixes #42.

Co-authored by Codex

AI disclosure: This work was prepared with assistance from OpenAI Codex.

Decode server-selected ZSTD blocks with CodecZstd. Exercise all compression
modes and read-only sessions against older and current ClickHouse servers in CI.
Remove redundant typed-global syntax from UInt64 hash constants for Julia 1.6.

Co-authored by Codex

AI disclosure: This work was prepared with assistance from OpenAI Codex.
@quinnj
quinnj merged commit 255dc26 into master Oct 3, 2026
4 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.

compression=COMPRESSION_LZ4 fails against servers that default to ZSTD network compression

1 participant