Skip to content

fix(client): disable native compression so reads work on ClickHouse 26.9 - #7

Merged
debba merged 1 commit into
TabularisDB:mainfrom
Badabum:fix/clickhouse-26-9-compression
Oct 12, 2026
Merged

debba merged 1 commit into
TabularisDB:mainfrom
Badabum:fix/clickhouse-26-9-compression

Conversation

@Badabum

@Badabum Badabum commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Fixes every read on ClickHouse 26.9+.

ClickHouse 26.9 switched the default codec to ZSTD(3) (ClickHouse/ClickHouse#108786), so compress=1 responses now use method byte 0x90. The clickhouse crate's LZ4 decoder only accepts 0x82, so every query, including the connection test, fails with decompression error: incorrect magic number (ClickHouse/clickhouse-rs#468). This turns off native compression in build_client. Once a crate release includes ClickHouse/clickhouse-rs#482, it can be turned back on.

Validation: cargo test --locked passed (3 tests). Against a local clickhouse-server:26.9.10.4, execute_query and get_databases failed with the magic number error before the change and return rows after it, including a paginated query.

ClickHouse 26.9 switched the default codec to ZSTD(3), so `compress=1`
responses use method byte 0x90. The clickhouse crate's LZ4 decoder only
accepts 0x82 and fails every read with "incorrect magic number"
(ClickHouse/clickhouse-rs#468).
@kilo-code-bot

kilo-code-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • src/main.rs - 0 issues

Reviewed by free · Input: 468.5K · Output: 26K · Cached: 410.1K

@debba

debba commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Thanks a lot @Badabum, great catch and a really clear write-up!

I verified it locally before merging: on clickhouse-server 26.9.16.11 every call on main (including test_connection) fails with incorrect magic number, while with this PR everything works, including pagination and a 200k-row result set. I also checked 25.8 for regressions and it behaves the same as before.

We'll re-enable compression once a clickhouse crate release ships ClickHouse/clickhouse-rs#482.

If you feel like it, you're very welcome to keep contributing to the ClickHouse plugin. We're looking for someone who actually uses ClickHouse day to day, and there's plenty to do. Feel free to open issues or PRs for anything you run into.

@debba
debba merged commit eb94b95 into TabularisDB:main Oct 12, 2026
1 check passed
@Badabum

Badabum commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

@debba hey, thanks for accepting the PR :) I actually use ClickHouse day-to-day through Tabularis, so will report issues if I find any. Cheers!

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