Skip to content

Remove Forced Window Functions Frame Logic - #129783

Merged
yariks5s merged 11 commits into
masterfrom
remove_forced_window_functions_frame_logic
Nov 13, 2026
Merged

yariks5s merged 11 commits into
masterfrom
remove_forced_window_functions_frame_logic

Conversation

@Michicosun

@Michicosun Michicosun commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

This patch removes getDefaultFrame and checkWindowFrameType from the window function interface and replaces them with the proper declaration of window function requirements.


Workflow [PR]
Sync PR [sync-upstream/pr/129783]

Version info

  • Merged into: 26.11.1.2243-master (included in 26.11 and later)

@clickhouse-gh

clickhouse-gh Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [541708c]

Summary: ✅


AI Review

Summary

The PR replaces function-specific default frames and frame restrictions with declared window requirements. lag, lead, ntile, percent_rank, and cume_dist can share windows with aggregates while retaining partition-wide semantics. Reviewed head 541708ce692d52241aa42176411f630cddbe827d; no new correctness findings. The earlier peer-group correctness and performance findings are addressed. The PR's Fast test report has no failures, and 152 additional queries covering both analyzers, partition boundaries, tied keys, block sizes, and ROWS/RANGE/GROUPS matched an independent oracle across 3,800 rows.

PR Metadata

Not for changelog does not require an entry, but the newly accepted explicit frames are a user-visible improvement. Suggested replacement category: Improvement.

Suggested changelog entry:

Allow explicit window frames for lag, lead, ntile, percent_rank, and cume_dist; these functions ignore the frame and operate on the whole partition.

Findings

💡 Nits

  • src/WindowFunctions/General/WindowFunctionCumeDist.cpp:59: [dismissed by author -- https://github.com/Remove Forced Window Functions Frame Logic #129783#discussion_r4549520435] The changelog concern remains applicable because previously rejected frame clauses now execute successfully. Use the category and entry above. This remains nonblocking; no further inline comment was posted.
Final Verdict

✅ Approve. No unresolved code blockers or majors, and no new inline findings. The dismissed metadata nit remains recorded above.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Nov 6, 2026
@yariks5s yariks5s self-assigned this Nov 6, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-window-functions Window function execution + frame handling (ROW_NUMBER/RANK/LAG/LEAD, frames, partitions, order). label Nov 6, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 541708ce6 with master 43871b94f (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Object file sizes

21 object files changed (-91.61 KiB total), 0 added.

Object file Master PR Δ
src/CMakeFiles/dbms.dir/WindowFunctions/General/WindowFunctionCumeDist.cpp.o 98.57 KiB 73.63 KiB -24.94 KiB (-25.30%)

711 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Slowest function optimization changes (ThinLTO)

Median per-function time ratio to the master baseline: programs/clickhouse ×0.61, programs/clickhouse-keeper ×0.64 (each binary is linked separately, on a different machine and with different build flags); deltas below are relative to it.

Binary Function Master PR Δ vs median
programs/clickhouse DB::registerFunctionConversion(DB::FunctionFactory&) 5.6 s 13.1 s +9.7 s (+285%)
programs/clickhouse _ZN6detail10static_forITk7is_enumN2DB23AttributeUnderlyingTypeEZNS1_29callOnDictionaryAttributeType… 3.3 s 7.2 s +5.1 s (+253%)
Compile time of recompiled translation units

141 translation units recompiled, 1279 s compile time in total, 141 of them have a recent master baseline.

Job report

@Michicosun Michicosun added the ignore-unresolved-threads Do not limit CI and block merge on unresolved review threads label Nov 7, 2026
@yariks5s
yariks5s added this pull request to the merge queue Nov 13, 2026
Merged via the queue into master with commit b9d6f6f Nov 13, 2026
204 checks passed
@yariks5s
yariks5s deleted the remove_forced_window_functions_frame_logic branch November 13, 2026 20:59
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-window-functions Window function execution + frame handling (ROW_NUMBER/RANK/LAG/LEAD, frames, partitions, order). ignore-unresolved-threads Do not limit CI and block merge on unresolved review threads pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants