risingwave icon indicating copy to clipboard operation
risingwave copied to clipboard

Incorrect result with `ORDER BY` in `OVER(PARTITION BY ...)`

Open YuanchengJiang opened this issue 2 years ago • 3 comments

Describe the bug

The result is not expected.

Error message/log

Actual result: [(1,),(2,)]

To Reproduce

CREATE TABLE test (c_0 INT);
INSERT INTO test VALUES (1);
INSERT INTO test VALUES (2);
SELECT DISTINCT count(1) OVER(PARTITION BY T1.c_0>=T1.c_0 ORDER BY 1) FROM test AS T1;

Expected behavior

Expected result: [(2,)]

How did you deploy RisingWave?

Docker

The version of RisingWave

PostgreSQL 9.5-RisingWave-1.3.0-alpha (60b342965d960ea2d6769d6c412f79318b42739e)

Additional context

No response

YuanchengJiang avatar Oct 12 '23 12:10 YuanchengJiang

Thanks for reporting this issue. This is a known limitation for now. Please see our documents for the note on this issue: https://docs.risingwave.com/docs/current/window-functions/#:~:text=EXCLUDE%20NO%20OTHERS-,NOTE,supported%20in%20RisingWave%2C%20the%20default%20values%20will%20be%20aligned%20with%20PostgreSQL.,-General%2Dpurpose%20window.

This issue is also described in #11593 and will be resolved once we have a basic RANGE frame support. The development of RANGE frame feature is tracked by #11109. You can subscribe that issue if you want timely notification for any updates.

stdrc avatar Oct 16 '23 17:10 stdrc

Temporarily I suggest to manually add ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING as a workaround.

stdrc avatar Oct 16 '23 17:10 stdrc

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. 😄

github-actions[bot] avatar Aug 01 '24 02:08 github-actions[bot]