-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default window frames to not match PostgreSQL #688
Comments
This seems like a very easy fix. I think we just match on order_by.is_some() and pick the appropriate default. To close, I think at a minimum we would want (1) a unit test to cover both options and (2) text in the |
Based on recommendation on discord, we may want to use |
From @Michael-J-Ward
|
Plan: Also allow for explicit setting of window frame bounds so we can do things like rows from preceeding unbounded to preceeding 1. That would allow us to do things like "get the last non-null value before the current row". The current interface cannot do that. |
Describe the bug
When no window frame is specified in the python implementation, we default to unbounded preceeding to current row. If we are to follow PostgreSQL implementation then we should set this value when
order_by
is specified and otherwise default to unbounded preceeding to unbounded following.To Reproduce
Produces:
Expected behavior
When
order_by
is not specified, default to unbounded preceeding to unbounded following.Additional context
The offending line of code appears to be here:
https://github.com/apache/datafusion-python/blob/main/src/functions.rs#L230
The text was updated successfully, but these errors were encountered: