goutamadwant opened a new pull request, #25816:
URL: https://github.com/apache/datafusion/pull/25816

   ## Which issue does this PR close?
   
   - Closes #24902.
   
   ## Rationale for this change
   
   Negative RANGE frame offsets can pass planning and cause an execution panic 
or incorrect window results. ROWS and GROUPS offsets are already rejected 
during planning.
   
   ## What changes are included in this PR?
   
   - Reject negative numeric RANGE offsets and intervals with any negative 
component after type coercion, for both PRECEDING and FOLLOWING bounds.
   - Check the original wider value when coercion to a narrow ORDER BY type 
would otherwise turn a negative offset into an unbounded bound.
   - Add optimizer unit tests and SQL logic regressions for negative, 
mixed-sign, and narrow-overflow cases.
   
   ## What is the testing strategy for this PR?
   
   - Both new optimizer unit tests pass.
   - The window SQL logic selection passes (7 files).
   - `cargo fmt --all -- --check`
   - `cargo clippy --all-targets --all-features -- -D warnings`
   
   ## Are there any user-facing changes?
   
   Negative RANGE offsets now produce a planning error instead of reaching 
execution. There is no public API change.


-- 
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]

Reply via email to