Repository navigation
Fix a crash of a window function over a Tuple with a sparse element - #115705
Conversation
|
Workflow [PR], commit [6682d6c] Summary: ✅
AI ReviewSummaryThis PR fixes the Final Verdict
LLVM Coverage ReportMeasured on commit 6682d6c.
Changed lines: Changed C/C++ lines covered: 5/5 (100.00%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units7 translation units recompiled, 11 s compile time in total, 7 of them have a recent master baseline. |
`recursiveRemoveSparse` only descends through `ColumnReplicated` and `ColumnTuple`, so a sparse leaf hidden under a `ColumnNullable` (for example `Tuple(a Nullable(String))` with `nullable_serialization_version = 'allow_sparse'`) survived into the window transform. Use `convertToFullIfWrapped`, which recursively strips `Const`/`Replicated`/`Sparse` through every subcolumn, and extend the test with a nullable tuple element.
…the test The previous settings produced `Default` serialization for the nullable element, so the case did not exercise the sparse path.
|
🕵 @groeneai, the following CI failures on this PR are unrelated to it — please investigate and provide fixes in separate PRs (link them here if already in progress):
The |
|
Both are unrelated to this PR. The first one is also a different defect from what the STID suggests.
Carrier is NATS |
|
Fix for the One correction to what I wrote above. The fuzzer did not rewrite the test's The actual root cause is not in That closes one arm of STID 4054-5dad, not the STID. |
Commit f9f2810 unintentionally moved the `contrib/aws-c-http` gitlink from `a9745ea9` to `8aefd899`. This PR is a `WindowTransform` fix and should not change what we build; restore the pointer that `master` has. Co-Authored-By: Claude Fable 5 <[email protected]>
…le with a sparse element
Backport #115705 to 26.8: Fix a crash of a window function over a Tuple with a sparse element
Two differences against 26.3 had to be reconciled: - 26.3 has no `should_materialize` filter, so the fix applies to its materialize-every-column loop; - 26.3 has no `convertToFullIfWrapped`: that is master's post-rename name, from #107773, which also split `LowCardinality` stripping out of it. The predecessor `convertToFullIfNeeded` is present here and performs the same recursion into subcolumns, which is the actual fix - the previous explicit `convertToFullColumnIfReplicated`/`Const`/`Sparse` chain only converted the top level, so a sparse element inside a Tuple stayed sparse. The outer `recursiveRemoveLowCardinality` is kept as it was on this branch. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Cherry pick #115705 to 26.3: Fix a crash of a window function over a Tuple with a sparse element
…le with a sparse element
Same two differences as the 26.3 cherry-pick: 26.6 has no `should_materialize` filter, so the fix applies to its materialize-every-column loop, and it has no `convertToFullIfWrapped` - that is master's name after #107773. The predecessor `convertToFullIfNeeded` is present here and does the same recursion into subcolumns, which is the fix: the explicit `convertToFullColumnIfReplicated`/`Const`/`Sparse` chain only converted the top level, leaving a sparse element inside a Tuple sparse. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Cherry pick #115705 to 26.6: Fix a crash of a window function over a Tuple with a sparse element
…le with a sparse element
Backport #115705 to 26.7: Fix a crash of a window function over a Tuple with a sparse element
Backport #115705 to 26.6: Fix a crash of a window function over a Tuple with a sparse element
Backport #115705 to 26.3: Fix a crash of a window function over a Tuple with a sparse element
…over a Tuple with a sparse element
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]>
…f upstream fixes The stateless selection gets the upstream tests of the 34 backports of the residual audit and of the two backports they depend on (ClickHouse#99085, ClickHouse#107562), 04627 (runnable with the gate's loopback Keeper), and 10317/10318 (Parquet Decimal512): 152 tests. 04670 (needs pyarrow) and 00900 (a long load test whose skip list changed) run outside the gate. known_defects.json: a fixed KD-UP entry per backport (fixed_by = its commit); KD-UP-108790 points at the ClickHouse#115705 backport, which carries its change; KD-UP-107663 records its ClickHouse#112601 dependency. Defects found by the release gate on the candidate 91efe1f244ce and fixed: KD-D512-PERF-OVERFLOW-CHECKS (e91167f), KD-TEST-BLOCKCHAIN-TYPENAME (f006d0d), KD-GATE-NO-KEEPER (095b89c). 80 entries, 0 open. Co-Authored-By: Claude Opus 5.5 <[email protected]>
WindowTransform::appendChunkmaterializes the columns that the window functions read withconvertToFullColumnIfSparse, which only looks at the top level of a column. ATupleis neversparse itself, but its elements can be, so a
Tuplewith a sparse element passed through unchangedand the aggregate function then read it as a full column.
groupConcat(t) OVER ()over aTuple(a String)whose element is serialized asColumnSparsecrashes the server.The aggregation path had the same problem and was fixed in #108790 by using
recursiveRemoveSparse;this does the same for the window functions.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a crash of a window function over a
Tuplewith a sparse element, for examplegroupConcat(t) OVER ().Workflow [PR]
Sync PR [sync-upstream/pr/115705]
Version info
26.8.1.2034,26.7.6.46,26.6.4.66,26.3.29.6