Skip to content

Use CompressionError for an unknown codec in ORC - #27

Merged
PedroTadim merged 1 commit into
ClickHouse/2.3.1from
fix-bad-compression
Sep 24, 2026
Merged

PedroTadim merged 1 commit into
ClickHouse/2.3.1from
fix-bad-compression

Conversation

@PedroTadim

@PedroTadim PedroTadim commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

@github-actions github-actions Bot added the CPP label Sep 24, 2026
@PedroTadim
PedroTadim merged commit eac29d0 into ClickHouse/2.3.1 Sep 24, 2026
1 check passed
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Sep 24, 2026
liborc's createDecompressor raised orc::NotImplementedYet for a compression
codec it does not implement. That derives from std::logic_error, and the
exception formatter treats an in-flight std::logic_error as an
internal-invariant violation and calls abortOnFailedAssertion on debug and
sanitizer builds, so a truncated ORC file whose postscript names codec 6 killed
the process with no output at all. On a release build it surfaced as Code: 1001,
type: orc::NotImplementedYet.

The codec is read from the file, so an unknown value is untrusted input rather
than an internal error. ClickHouse/orc#27 raises orc::CompressionError there
instead, a std::runtime_error. This bumps contrib/orc from 6a2fe65e to eac29d0b
to pick that up.

With the library fixed, the createORCReader wrapper added for this issue is
dead, so both call sites go back to orc::createReader. The codec arm was the
only orc::NotImplementedYet a file could reach while the reader is constructed:
convertType's default arm sits behind a proto2 closed enum whose 21 declared
kinds it all handles, so an unknown wire value never gets there, and every
other site in the library is on the writer path, behind API misuse, or reached
only after construction (row-reader creation, per-stripe reading, statistics
access, type printing), none of which the removed catch covered.

The reader-construction arms of 05036_orc_unimplemented_codec_no_abort now
assert orc::CompressionError and the codec number. Reverting the library throw
to NotImplementedYet puts all five back to "no output at all", so the test still
pins the abort rather than only the message.

Related: ClickHouse#115412
@PedroTadim
PedroTadim deleted the fix-bad-compression branch September 28, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant