Repository navigation
Introduce Frame Abstraction for WindowTransform - #124175
Conversation
…ndow_functions_model_frame
|
Workflow [PR], commit [9aa30a1] Summary: ❌
AI ReviewSummaryThis PR refactors Missing context / blind spots
Findings
Final Verdict✅ I did not find a new PR-introduced blocker in the refactor itself, so I am not adding a new inline review batch. The one substantive concern that remains is the previously discussed explicit- |
Build profile diff (arm_release)Commit See the job log for details. |
There was a problem hiding this comment.
The changes are good for me, though they show memory and speed degradation in some niche corner cases. They are mostly because of the index representation in the form of this "row belongs to group…" instead of "a peer group starts here" which takes 8 bytes instead of one bit
I'm checking what we can do here, but it is not a blocker for me. Design-wise and execution-wise, it is good
Upd: this makes it faster, but I'm not sure we should proceed with it fix.patch
…sets `compareNullableRangeOffset` ranks NULL below every value and never sees `nulls_direction`, so with NULL rows a `RANGE` offset frame is wrong under `NULLS LAST` (the default for `ASC`) and `DESC NULLS FIRST`, as `05269` documents for the `Nullable(Int32)` keys master already supports. On a `Nullable(Decimal32(1))` key over [NULL, 1, 2, 3, NULL], `count() OVER (ORDER BY n RANGE 1 PRECEDING)` gave 4 for the NULL rows instead of 2, and `DESC NULLS FIRST` gave every row the whole partition. Master rejects the key with `NOT_IMPLEMENTED`, so routing it through that comparator would turn an error into wrong results. The four decimal widths now get a comparator only for a non-`Nullable` key; a `Nullable` one keeps master's `NOT_IMPLEMENTED` until the NULL ordering honours `NULLS LAST` (ClickHouse#124175). The `Nullable` arms leave `02892`, and `05257` pins the rejection next to the other unsupported key types. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ClickHouse#124175 replaced the per-row peer group start flags in SlidingIndex with peer group indexes, so the separate ORDER BY index used by rank and dense_rank under a ROWS frame is now an index too. It is computed by master's assignPeerGroupIndexes with the frame type and the collation comparison passed in, instead of a second copy of that logic, and the transform moves order_by_peer_group_start when the index changes, the same way master moves peer_group_start. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@Michicosun @yariks5s — ClickGap found the following in this PR:
Close anything that's wrong or already addressed. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
This patch introduces the frame abstraction needed for window calculation in the window transform and isolates border-related logic into separate files.
Workflow [PR]
Sync PR [sync-upstream/pr/124175]
Version info
26.10.1.2336-master(included in26.10and later)