Repository navigation
Support the bzip2 and xz codecs in the Avro format - #127774
Conversation
The Avro specification lists them as optional codecs. Reading such files failed with `Unknown codec in data file`. They can also be written now with `output_format_avro_codec`. The Boost.Iostreams filters for them are compiled into the `avro` library, because Boost is added before `bzip2` and `xz`. The test data files are from `apache/arrow-testing`. Closes: #125147 Related: ClickHouse/avro#45 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [17c15e1] Summary: ✅
AI ReviewSummaryAdds Final Verdict✅ Approve |
The `timestamp_col` of `alltypes_plain` was printed in the randomized `session_timezone`. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=127774&sha=f76faebedd2e777830946ffc400445ec8764ae56&name_0=PR #127774 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Update the `avro` submodule, which now propagates decompressor errors instead of treating them as the end of data. Previously, a truncated `bzip2` or `xz` block was read successfully when the decoded records filled the input buffer exactly. Address review: #127774 Related: ClickHouse/avro#46 Co-Authored-By: Claude Opus 5.5 <[email protected]>
With `badbit` in the exception mask of the decompressing stream, its read rethrows the error of the decompressor, e.g. `boost::iostreams::zlib_error`, which is not an `avro::Exception`, so ClickHouse reported a corrupted `deflate` block as `STD_EXCEPTION` instead of `AVRO_EXCEPTION`. Wrap it in `IStreamBufferCopyIn`. Related: ClickHouse/ClickHouse#127774 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Update the `avro` submodule: after the previous change, a decompressor error of a corrupted `deflate` block propagated as `boost::iostreams::zlib_error` and was reported as `STD_EXCEPTION`, which broke `04947_avro_count_from_files_forward_progress`. The decompressor errors are now wrapped in `avro::Exception`. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=127774&sha=latest&name_0=PR&name_1=Stateless%20tests%20(amd_debug%2C%20parallel) Related: ClickHouse/avro#46 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=127774&sha=latest&name_0=PR&name_1=Integration%20tests%20(arm_binary%2C%203%2F4) ( The other failure, |
|
The fix is in #127787 (open, test-only). The integration harness randomizes |
|
🕵 Thanks, @groeneai: the The only remaining red check on |
|
🕵 The re-run of |
|
🕵 On |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes33 object files changed (+241.90 KiB total), 2 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units2474 translation units recompiled, 12660 s compile time in total, 2471 of them have a recent master baseline. |
…house-local` Tests `03536_ch_as_client_and_local` and `03134_positional_arguments` invoke the `clickhouse` binary in local mode without `--path` or `--tmp`, so it locks the persistent data directory `~/.local/share/clickhouse-local`. When two such invocations run concurrently, one of them fails with `Cannot lock file .../clickhouse-local/status. Another server instance in same directory is already running`. Point `HOME` and `XDG_DATA_HOME` at a per-test directory, as tests `05038_clickhouse_local_default_path` and others already do. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=127774&sha=af134d26ecffd69a4d3aea84773369f50b35be87&name_0=PR&name_1=Fast%20test ClickHouse#127774 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 On
|
…`xz` in `Avro` #127774 added support for the `bzip2` and `xz` codecs in the `Avro` format, so `data/avro/alltypes_plain.bzip2.avro` and `data/avro/alltypes_plain.xz.avro` are now read, with the same contents as `data/avro/alltypes_plain.avro`. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125134&sha=59dd252d208615c700b477812e3bbb00194d6499&name_0=PR PR: #125134 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…a home of their own Since ClickHouse#116042, clickhouse-local without --tmp or --path works in a designated directory in the home ($XDG_DATA_HOME/clickhouse-local or ~/.local/share/clickhouse-local; ~/Library/Application Support on macOS) and holds a lock on its `status` file for the whole run. That change gave $CLICKHOUSE_LOCAL a --tmp, but these three tests start clickhouse-local through the bare ${CLICKHOUSE_BINARY}, so all their local-mode runs in a CI job share the job's one default directory. When two of them overlap (two of these tests at the same time in a parallel job, or two copies of one test in the flaky check), the second fails with "Code: 76 ... Cannot lock file .../clickhouse-local/status". Seen on PR ClickHouse#124882 (03267, Stateless tests (amd_debug, parallel)) and PR ClickHouse#127774 (03536, Fast test). Prefix each local-mode line with a per-test HOME under CLICKHOUSE_TMP and an empty XDG_DATA_HOME (an absolute one wins over HOME on Linux), the same form ClickHouse#116042 uses in its own default-directory tests. The argv of every invocation is unchanged, so the dispatch rules of programs/main.cpp that these tests pin stay covered, including the no-argument rule that only 03267 exercises (`clickhouse < file`); --tmp would have turned that line into the dash-option rule. Client-mode lines and $CLICKHOUSE_LOCAL lines are untouched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Avro specification lists
bzip2andxzas optional codecs. ClickHouse could not read Avro files that use them (Unknown codec in data file: bzip2), although it already links both libraries. Now they are supported for reading, and can also be used for writing withoutput_format_avro_codec.The codecs are implemented in the
avrofork (ClickHouse/avro#45) with the Boost.Iostreamsbzip2andlzmafilters. These filters are compiled into theavrolibrary, because Boost is added to the build beforebzip2andxz. Thexzfilter is built without its multithreaded encoder, so writing does not spawn threads.The test reads the
alltypes_plainfiles fromapache/arrow-testing, written by another implementation, does a round trip with several blocks, and checks that a truncated compressed block is rejected (ClickHouse/avro#46 propagates decompressor errors instead of treating them as the end of data). I also checked that files written by ClickHouse with both codecs are read correctly byfastavro.Closes: #125147
Related: ClickHouse/avro#45
Related: ClickHouse/avro#46
Related: #125134
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Support the
bzip2andxzcodecs in theAvroformat, both for reading and for writing (output_format_avro_codec).🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/127774]
Version info
26.11.1.982-master(included in26.11and later)