Repository navigation
Fix bad cast exception in kql_array_sort with constant array arguments - #98251
Merged
Merged
Conversation
…with constant array arguments The `tupleElement` result could be a `ColumnConst` wrapping a `ColumnArray` when the first array argument is a constant (e.g. empty array literal `[]`). The code tried to cast it directly to `ColumnArray` without unwrapping, causing a logical error "Bad cast from type DB::ColumnConst to DB::ColumnArray". https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=12fa973a02c8e877fdd81efd696be1108834388a&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_debug%2C%20distributed%20plan%2C%20s3%20storage%2C%20parallel%29 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
|
Workflow [PR], commit [8b74075] Summary: ❌
|
nickitat
approved these changes
Feb 27, 2026
alexey-milovidov
added a commit
that referenced
this pull request
Mar 1, 2026
…d-cast Fix bad cast exception in kql_array_sort with constant array arguments
Contributor
|
Hi @alexey-milovidov @nickitat — while reviewing this PR I found the following:
Happy to discuss — close anything that's wrong or already addressed. |
Contributor
|
Apologies for the duplicate notification — we had a race condition in our notification system where multiple processes posted simultaneously. The duplicate has been removed and we've added a strict 3-layer dedup guard (DB lock + immediate key + GitHub comment check) to ensure this cannot happen again. |
This was referenced Apr 8, 2026
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
DB::ColumnConsttoDB::ColumnArray" inkql_array_sort_asc/kql_array_sort_descwhen a constant array argument (e.g.[]) is passedtupleElementresult was not unwrapped fromColumnConstbefore casting toColumnArrayconvertToFullColumnIfConstcall before the castCI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=12fa973a02c8e877fdd81efd696be1108834388a&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_debug%2C%20distributed%20plan%2C%20s3%20storage%2C%20parallel%29
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix logical error "Bad cast from type DB::ColumnConst to DB::ColumnArray" in
kql_array_sort_asc/kql_array_sort_descwhen called with constant array arguments.Documentation entry for user-facing changes
🤖 Generated with Claude Code
Version info
26.3.1.160