Repository navigation
Introduce Partition Abstraction for WindowTransform - #123260
Conversation
…tions_model_partition
|
Workflow [PR], commit [9b5ee1c] Summary: ✅
AI ReviewSummaryThis PR refactors Final VerdictStatus: ✅ Approve LLVM Coverage ReportMeasured on commit 9b5ee1c.
Changed lines: Changed C/C++ lines covered: 162/163 (99.39%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes13 object files changed (+41.49 KiB total), 2 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units22 translation units recompiled, 47 s compile time in total, 20 of them have a recent master baseline. |
…Params peer check Master's window refactor (ClickHouse#122762, ClickHouse#123260, ClickHouse#123737) moved the peer comparison into WindowTransformParams::arePeers and added SlidingIndexes, which marks peer-group starts for every RANGE and GROUPS frame with raw compareAt / getEqualRangeEndAssumeSorted. The input is sorted with the ORDER BY collator, so collation-equal values that differ in bytes (for example 'a' and 'A' under 'en-u-ks-level2') are interleaved, and the raw scan either cuts a peer group short or trips the debug check "Equal values are not contiguous within the range assumed to be sorted". Since ClickHouse#123737 this aborts deterministically for an ordinary collated rank(): SELECT rank() OVER (ORDER BY x COLLATE 'en-u-ks-level2') FROM (SELECT if(number % 2, 'a', 'A') AS x FROM numbers(1000)) The previous version of this fix lived in WindowTransform methods that the refactor removed, so it is re-done on the new structure. WindowTransformParams gets the collation flag and two helpers, haveEqualOrderByValues and getOrderByEqualRangeEnd, and every ORDER BY peer comparison goes through them: arePeers (cume_dist and the GROUPS cross-block check), the SlidingIndexes block boundary and in-block scan, the RANGE frame-end check and scan, and the GROUPS peer-group scan. PARTITION BY keys stay raw, as PARTITION BY cannot carry COLLATE. The helpers are inline in the header with the collated comparison in out-of-line cold functions, so an uncollated window keeps the inlined raw comparison of master: the earlier out-of-line version of these calls cost 15-19% on window_function_with_order in the arm performance check. The test gains the deterministic 1000-row case above (also for GROUPS), a cume_dist case and a one-row-per-block rank() case, so each of the six comparison sites has an assertion that fails when only that site compares raw. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Based on #123026
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
This patch adds a row-range partition abstraction to simplify the
WindowTransformlogic.Workflow [PR]
Sync PR [sync-upstream/pr/123260]
Version info
26.10.1.1395-master(included in26.10and later)