Skip to content
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

Support window functions with window frame #361

Closed
jimexist opened this issue May 19, 2021 · 8 comments
Closed

Support window functions with window frame #361

jimexist opened this issue May 19, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@jimexist
Copy link
Member

jimexist commented May 19, 2021

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
(This section helps Arrow developers understand the context and why for this feature, in addition to the what)

Implement frame spec in window clause

Describe the solution you'd like
A clear and concise description of what you want to happen.

We'd like to support window function in three or more steps:

  1. Support window functions with basic logical planning and physical planning #359 basic structure
  2. Support window functions with empty OVER clause #298 empty over clause
  3. Support window functions with PARTITION BY clause #299 with partition clause
  4. Support window functions with order by #360 with order by
  5. Support window functions with window frame #361 with window frame (this one)

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@alamb
Copy link
Contributor

alamb commented Sep 16, 2022

For anyone following this, a window frame query looks like this (the ROWS BETWEEN 2 PRECEDING AND 0 FOLLOWING)

SELECT water_level, avg(water_level) OVER (ORDER BY time desc ROWS BETWEEN 2 PRECEDING AND 0 FOLLOWING)
FROM
  "h2o_feet"
WHERE
  time >= cast ('2019-09-17T20:00:00Z' as timestamp) AND
  time <= cast ('2019-09-17T21:42:00Z' as timestamp);

Which results in an error

This feature is not implemented: window expression with window frame definition is not yet supported

@alamb
Copy link
Contributor

alamb commented Sep 16, 2022

It appears there is some work afoot to support this in https://github.com/synnada-ai/arrow-datafusion/pull/1

@ozankabak
Copy link
Contributor

It appears there is some work afoot to support this in synnada-ai#1

Yes, we plan to submit a PR draft early next week that makes progress on this issue. We hope to resolve it fully once we get community feedback.

@Ted-Jiang
Copy link
Member

i am going to fix this window func issue. So we can do window func in ballista ✌️

@Ted-Jiang
Copy link
Member

Ted-Jiang commented Dec 2, 2022

I have run some query success in out internal version ballista 😄 and fix some issues.

@Ted-Jiang
Copy link
Member

@ozankabak Thanks again for supporting window frame.👍

@alamb
Copy link
Contributor

alamb commented Dec 2, 2022

I am going to claim this ticket is done. Thank you to the Synnada team and @ozankabak and @mustafasrepo for helping make it happen 👏

@alamb alamb closed this as completed Dec 2, 2022
@ozankabak
Copy link
Contributor

You are welcome, looking forward to helping in the future too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants