Repository navigation
fix(client): disable native compression so reads work on ClickHouse 26.9 - #7
Conversation
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).
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
Reviewed by free · Input: 468.5K · Output: 26K · Cached: 410.1K |
|
Thanks a lot @Badabum, great catch and a really clear write-up! I verified it locally before merging: on We'll re-enable compression once a 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 hey, thanks for accepting the PR :) I actually use ClickHouse day-to-day through Tabularis, so will report issues if I find any. Cheers! |
Fixes every read on ClickHouse 26.9+.
ClickHouse 26.9 switched the default codec to ZSTD(3) (ClickHouse/ClickHouse#108786), so
compress=1responses now use method byte 0x90. Theclickhousecrate's LZ4 decoder only accepts 0x82, so every query, including the connection test, fails withdecompression error: incorrect magic number(ClickHouse/clickhouse-rs#468). This turns off native compression inbuild_client. Once a crate release includes ClickHouse/clickhouse-rs#482, it can be turned back on.Validation:
cargo test --lockedpassed (3 tests). Against a localclickhouse-server:26.9.10.4,execute_queryandget_databasesfailed with the magic number error before the change and return rows after it, including a paginated query.