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

ORDER BY is not implemented for window functions #11748

Open
2 tasks done
manticore-projects opened this issue Apr 20, 2024 · 2 comments
Open
2 tasks done

ORDER BY is not implemented for window functions #11748

manticore-projects opened this issue Apr 20, 2024 · 2 comments
Labels
expected behavior The behavior described in the issue is expected

Comments

@manticore-projects
Copy link

What happens?

ORDER BY is not implemented for window functions

To Reproduce

-- fails: ORDER BY is not implemented for window functions!
select listagg(id ) 
within group (order by id)
over() from (select UNNEST([3,2,1]) AS id);

-- fails: ORDER BY is not implemented for window functions!
select listagg(id order by id) 
over() from (select UNNEST([3,2,1]) AS id);

-- works and produces the correct order
select listagg(id) 
over() from (select UNNEST([3,2,1]) AS id order by id);

OS:

Linux

DuckDB Version:

10.0.2

DuckDB Client:

Java

Full Name:

Andreas Reichel

Affiliation:

manticore-projects.com

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have
@soerenwolfers
Copy link

See #10966

But for your particular examples just put the ORDER BY clause in the window definition and use Rows between unbounded preceding and unbounded following, see https://duckdb.org/docs/sql/window_functions.html

@hawkfish
Copy link
Contributor

This is a feature request, and we have the underlying algorithms in place, but it will be post v1.0 before I get to it. Also, it is behind a memory usage rewrite that is in process.

@hawkfish hawkfish added expected behavior The behavior described in the issue is expected and removed needs triage labels Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expected behavior The behavior described in the issue is expected
Projects
None yet
Development

No branches or pull requests

3 participants