Skip to content

branch-4.0: [fix](window) allow constant expression evaluation in LAG/LEAD offset parameter #58200#58261

Merged
yiguolei merged 1 commit intobranch-4.0from
auto-pick-58200-branch-4.0
Nov 25, 2025
Merged

branch-4.0: [fix](window) allow constant expression evaluation in LAG/LEAD offset parameter #58200#58261
yiguolei merged 1 commit intobranch-4.0from
auto-pick-58200-branch-4.0

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #58200

… parameter (#58200)

### What problem does this PR solve?
Problem Summary:

```
mysql> select lag(k1,1+1,6) over() from test_query_qa.baseall;
ERROR 1105 (HY000): errCode = 2, detailMessage = The offset parameter of LAG must be a constant positive integer: lag(k1, (1 + 1), 6)
mysql>
``` 

before the function second param of offset must be a constant value.
but 1 + 1 also should be support in offset params.

```
mysql> select lag(k1,1+1,6) over() from test_query_qa.baseall where k1 <= 3;
+----------------------+
| lag(k1,1+1,6) over() |
+----------------------+
|                    6 |
|                    6 |
|                    3 |
+----------------------+
```
@github-actions github-actions bot requested a review from yiguolei as a code owner November 23, 2025 14:30
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hello-stephen
Copy link
Contributor

run buildall

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 0.00% (0/1) 🎉
Increment coverage report
Complete coverage report

@yiguolei yiguolei closed this Nov 25, 2025
@yiguolei yiguolei reopened this Nov 25, 2025
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 25, 2025
@github-actions
Copy link
Contributor Author

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor Author

PR approved by anyone and no changes requested.

@yiguolei yiguolei merged commit 8fa5b98 into branch-4.0 Nov 25, 2025
25 of 27 checks passed
@github-actions github-actions bot deleted the auto-pick-58200-branch-4.0 branch November 25, 2025 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments