Skip to content

fix(plan): infer prepared lag lead offsets - #27225

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:m-26865
Aug 17, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:m-26865

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 #26865

What this PR does / why we need it:

fix(plan): infer prepared lag lead offsets

@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 →

@aptend aptend 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.

Deep review on the exact head found no blocking issue. A bare prepared LAG/LEAD offset now gets the integer vector type required by the window executor, while literals, columns, and explicitly typed expressions retain their existing binding paths. The cast remains around the ParamRef through plan copying/fill, composes with the existing third-argument default cast, and propagates cast-construction errors. Focused binder and prepare/fill tests pass repeatedly; git diff --check is clean.

@mergify

mergify Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@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.

Deep review on exact head d3095b8 found no blocking issue. The failure chain and fix are coherent: bare prepared LAG/LEAD offsets previously remained text, while the executor accepts only integer vectors; binding the direct marker through an int64 cast before overload resolution preserves that cast through plan copy/fill and composes with the existing third/default-argument cast. Literal, column, and explicitly typed offset paths are unchanged. The SQL PREPARE/EXECUTE regression covers both LAG and LEAD, focused tests pass, the complete pkg/sql/plan suite passes locally, and diff --check is clean.

@mergify mergify Bot added the queued label Aug 17, 2026
@mergify

mergify Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-17 09:12 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-08-17 09:40 UTC · at 3fed129170818aec667ecfb5cd8a141846682e47

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

Reason

Pull request #27225 has been merged manually at 484e196

Hint

You were too fast!

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

  • Requeue this pull request

@XuPeng-SH
XuPeng-SH merged commit 484e196 into matrixorigin:main Aug 17, 2026
24 of 26 checks passed
@mergify mergify Bot removed the queued label Aug 17, 2026
@iamlinjunhong
iamlinjunhong deleted the m-26865 branch August 23, 2026 17:13
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#26865

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

fix(plan): infer prepared lag lead offsets

---------

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#26865

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

fix(plan): infer prepared lag lead offsets

---------

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#26865

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

fix(plan): infer prepared lag lead offsets

---------

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/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants