Repository navigation
Backport #115705 to 26.3: Fix a crash of a window function over a Tuple with a sparse element - #117073
Conversation
…le with a sparse element
|
Workflow [BackportPR], commit [6a26447] Summary: ✅ |
The backported test crashed on `26.3` with `Bad cast from type DB::ColumnSparse to DB::ColumnString` already in the plain `SELECT groupConcat(t)` query, before reaching the window function that this backport is about. `Aggregator::prepareAggregateInstructions` on `26.3` only strips top-level sparsity from aggregate arguments. A column that is dense at the top level but holds sparse subcolumns - exactly a `Tuple` with a sparse element - was left un-materialized and took the regular `add` path, where `SerializationString::serializeTextQuoted` does `assert_cast<const ColumnString &>` and aborts. Cherry-pick the one-line condition (and its test) from #108790, which is on `master` but was never backported: keep the argument sparse only when it is a genuine top-level `ColumnSparse`, which is the only form the `addBatchSparse` fast path consumes. `recursiveRemoveSparse` is a no-op when there is nothing sparse to strip, so the dense and top-level-sparse paths are unchanged. Verified against the `26.3` CI binary of this pull request: the reference output of `04416_groupconcat_tuple_sparse_subcolumn` matches, and the query aborts without this fix. Related: #108790
|
🕵 Both red jobs ( Root cause: Pushed:
Verified against the Note: the sibling backport #117076 (to |
AGG: window function over a Tuple with a sparse element -> crash. Effect in the production build a394e92: wrong/failing (the upstream test fails on it and passes on official 26.8.8.8; evidence/fix_ci_20260925/upstream_repro/residual/115705.PROD263.txt). Upstream patch unchanged, with its test(s): 04416_groupconcat_tuple_sparse_subcolumn, 05025_group_concat_window_sparse_tuple. It also contains the fix of ClickHouse#108790 (groupConcat over a Tuple with a sparse String, 26.3 backport ClickHouse#117568, reproduced on the production build: evidence/fix_ci_20260925/upstream_repro/residual/108790.PROD263.txt): the 26.3 backport ClickHouse#117073 carries the identical Aggregator.cpp change and test 04416, so ClickHouse#108790 needs no separate commit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Original pull-request #115705
Cherry-pick pull-request #117058
This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.
The PR source
The PR is created in the CI job
Version info
26.3.29.6