8000 Support `OVER` clause without `PARTITION BY` · Issue #11505 · risingwavelabs/risingwave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support OVER clause without PARTITION BY #11505

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

Closed
Tracked by #9124
stdrc opened this issue Aug 7, 2023 · 3 comments
Closed
Tracked by #9124

Support OVER clause without PARTITION BY #11505

stdrc opened this issue Aug 7, 2023 · 3 comments
Assignees

Comments

@stdrc
Copy link
Member
stdrc commented Aug 7, 2023

No description provided.

@st1page
Copy link
Contributor
st1page commented Sep 11, 2023

write a partition by 1 could be a workaround

dev=> explain create materialized view mv as select lag(1) over (partition by 1 order by v) from t; 
                                                                             QUERY PLAN                                                                             
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
 StreamMaterialize { columns: [lag, t._row_id(hidden), 1:Int32(hidden)], stream_key: [t._row_id, 1:Int32], pk_columns: [t._row_id, 1:Int32], pk_conflict: NoCheck }
 └─StreamProject { exprs: [first_value, t._row_id, 1:Int32] }
   └─StreamOverWindow { window_functions: [first_value(1:Int32) OVER(PARTITION BY 1:Int32 ORDER BY t.v ASC ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING)] }
     └─StreamExchange { dist: HashShard(1:Int32) }
       └─StreamProject { exprs: [t.v, 1:Int32, t._row_id] }
         └─StreamTableScan { table: t, columns: [v, _row_id] }
(6 rows)

@stdrc
Copy link
Member Author
stdrc commented Nov 23, 2023

A late summary:

Simply implementing the support is easy, but as discussed with @st1page, we want our user to carefully write such queries involving window function calls especially rank functions. If the query matches TopN pattern, over clause without partition by works; if not, a partition by 1::int workaround is required. This can force our users knowing what they are doing.

So we won't implement this feature in near future.

@stdrc stdrc removed this from the future-release-1.6 milestone Nov 23, 2023
@stdrc stdrc added this to the future-release-1.9 milestone Mar 6, 2024
@stdrc stdrc removed this from the release-1.9 milestone May 9, 2024
Copy link
Contributor
github-actions bot commented Aug 1, 2024

This issue has been open for 60 days with no activity.

If you think it is still relevant today, and needs to be done in the near future, you can comment to update the status, or just manually remove the no-issue-activity label.

You can also confidently close this issue as not planned to keep our backlog clean.
Don't worry if you think the issue is still valuable to continue in the future.
It's searchable and can be reopened when it's time. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0