mustafasrepo opened a new pull request, #4078:
URL: https://github.com/apache/arrow-datafusion/pull/4078
# Which issue does this PR close?
Closes #4076.
# Rationale for this change
With this change, we can now run built-in window functions with custom
window frames such as queries in the form
```sql
SELECT
FIRST_VALUE(c4) OVER(ORDER BY c9) as first_value1,
FIRST_VALUE(c4) OVER(ORDER BY c9) as first_value2,
LAST_VALUE(c4) OVER(ORDER BY c9) as last_value1,
LAST_VALUE(c4) OVER(ORDER BY c9) as last_value2
FROM aggregate_test_100
ORDER BY c9
LIMIT 5
```
# What changes are included in this PR?
- We added range calculation support for Builtin-window functions
FIRST_VALUE, LAST_VALUE, NTH_VALUE (For other window functions what is inside
window frame isn’t important
[https://www.postgresql.org/docs/current/functions-window.html](https://www.postgresql.org/docs/current/functions-window.html)).
To be able to use range calculation code for both window functions and
aggregate functions, range calculation code is moved from
[aggregate.rs](https://github.com/synnada-ai/arrow-datafusion/blob/feature/builtin_window_running/datafusion/physical-expr/src/window/aggregate.rs)
to
[window_expr.rs](https://github.com/synnada-ai/arrow-datafusion/blob/feature/builtin_window_running/datafusion/physical-expr/src/window/window_expr.rs).
- Added tests for Built-in Window Functions
# Are there any user-facing changes?
N.A
--
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]