jacktengg opened a new pull request, #68455:
URL: https://github.com/apache/doris/pull/68455
Issue Number: N/A
Related PR: N/A
Problem Summary: LEAD with an offset of 9223372036854775807 on a two-row
input can overflow BE's signed int64 exclusive frame end and abort the process.
Restrict LEAD and LAG offsets to 2147483647 in the shared FE validation, both
before type coercion and after expression rewriting so arithmetic expressions
and explicit casts cannot bypass the limit. Keep zero offsets and the existing
BIGINT signatures. Replace disabled crash examples with executable rejection
cases and cover the accepted boundary, default values, and expression offsets.
LEAD and LAG now reject offsets greater than 2147483647 during query
planning, including previously accepted very large offsets that returned
default values. This prevents extreme LEAD offsets from crashing BE.
- Test: Unit Test / Regression test / Manual test
- 24 FE unit tests passed (LeadLagOffsetTest and
CheckAndStandardizeWindowFunctionTest).
- build.sh --fe -j8 passed, including Checkstyle.
- test_lead_lag_large_offset and test_lead_lag_nullable regression
suites passed.
- Generated and verified regression output with run-regression-test.sh.
- Original reproducer returns an FE error; BE remains alive with
unchanged start time.
- Behavior changed: Yes (LEAD/LAG offsets must be between 0 and 2147483647).
- Does this need documentation: Yes (document the LEAD/LAG offset limit; no
doc PR yet).
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]