Skip to content

fix: honor default frames for value window functions - #28152

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
iamlinjunhong:m-27341
Sep 4, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
iamlinjunhong:m-27341

Conversation

@iamlinjunhong

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #27341

What this PR does / why we need it:

fix: honor default frames for value window functions

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved on exact head 5d66b83f01feb8ced4aa629490f18766f3d6ee3c.

The fix correctly narrows the old full-partition override to the frame-independent value functions LAG/LEAD. FIRST_VALUE, LAST_VALUE, and NTH_VALUE now retain the normal ordered default frame (RANGE UNBOUNDED PRECEDING through CURRENT ROW), while an omitted frame without ORDER BY still covers the full partition and explicit frames remain unchanged.

Counterexamples checked:

  • peer rows and NTH_VALUE before the requested row enters the frame;
  • no ORDER BY;
  • explicit full-partition ROWS frame;
  • LAG and LAST_VALUE consuming the same named window without cross-mutation;
  • existing NULL/frame executor coverage.

Performance: this adds no sort, materialization, or retained memory. Frame-sensitive functions use the already-built peer boundaries; the per-row boundary lookup remains within the existing window-sort complexity. Exact-head Linux UT/SCA/BVT are green, and the new BVT was selected by the successful proxy job. No correctness, unhappy-path, hang, or performance blocker found.

@mergify mergify Bot added the queued label Sep 4, 2026
@mergify

mergify Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-04 10:30 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-09-04 10:39 UTC · at 8e47abe4fcac4f55d897ced341fbaeed55ec9d2e

This pull request spent 9 minutes 16 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

This pull request seems to come from a fork, and Mergify needs the author's permission to update its branch.
The author needs to enable "Allow edits from maintainers" on this pull request, or update the branch manually.

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#27341

## What this PR does / why we need it:

fix: honor default frames for value window functions

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#27341

## What this PR does / why we need it:

fix: honor default frames for value window functions

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#27341

## What this PR does / why we need it:

fix: honor default frames for value window functions

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants