Repository navigation
Fix LOGICAL_ERROR in schema inference for formats without schema reader - #98373
Merged
Merged
Conversation
…chema reader
When `file('')` is used and the format is auto-detected from a filename
extension (e.g. `.capnp` → CapnProto), but all matched files are empty,
the code at `readSchemaFromFormatImpl` skips the schema reader check
(line 244) via the EOF `continue` path and reaches the post-loop
`getSchemaReader` call (line 447) which throws `LOGICAL_ERROR` for
formats that only have an external schema reader (like CapnProto).
In debug/ASan builds with `abort_on_logical_error`, this causes SIGABRT.
The previous fix (b089160, #66888) added the check inside the while
loop but missed this post-loop code path.
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=98346&sha=9d3c3b9449238c3908fc7a5c355f084920261723&name_0=PR&name_1=Stateless%20tests%20%28arm_asan%2C%20azure%2C%20parallel%29
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
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.
Summary
When
file('')is used and the format is auto-detected from a filename extension (e.g..capnp→ CapnProto), but all matched files are empty, the code inreadSchemaFromFormatImplskips the schema reader check via the EOFcontinuepath and reaches the post-loopgetSchemaReadercall which throwsLOGICAL_ERRORfor formats that only have an external schema reader (like CapnProto, Protobuf).In debug/ASan builds with
abort_on_logical_error, this causes SIGABRT and crashes the server.A previous fix (b089160, #66888) added a check inside the while loop but missed the post-loop code path at line 447.
The fix adds the same
checkIfFormatHasSchemaReaderguard before the post-loopgetSchemaReadercall.CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=98346&sha=9d3c3b9449238c3908fc7a5c355f084920261723&name_0=PR&name_1=Stateless%20tests%20%28arm_asan%2C%20azure%2C%20parallel%29
#98346
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
🤖 Generated with Claude Code