Use CompressionError for an unknown codec in ORC - #27
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For ClickHouse/ClickHouse#115889