Skip to content

feat: Support SELECT DISTINCT ON - #221

Merged
MazterQyou merged 1 commit into
cubesql-3-04-2022from
cubesql/distinct-on
Jul 16, 2026
Merged

feat: Support SELECT DISTINCT ON#221
MazterQyou merged 1 commit into
cubesql-3-04-2022from
cubesql/distinct-on

Conversation

@MazterQyou

@MazterQyou MazterQyou commented Jul 15, 2026

Copy link
Copy Markdown
Member

This PR implements SELECT DISTINCT ON (...), which was previously silently ignored during planning: it is planned as a ROW_NUMBER() window partitioned by the ON expressions and ordered by the query's ORDER BY, followed by a filter keeping the first row per partition, with Postgres validation that ORDER BY starts with the ON expressions. Related test is included.

@MazterQyou
MazterQyou force-pushed the cubesql/distinct-on branch 2 times, most recently from 4f27d07 to a9c4984 Compare July 15, 2026 17:24
Signed-off-by: Alex Qyoun-ae <4062971+MazterQyou@users.noreply.github.com>
@MazterQyou
MazterQyou force-pushed the cubesql/distinct-on branch from a9c4984 to b36b8e5 Compare July 16, 2026 21:42
@MazterQyou
MazterQyou merged commit 400af46 into cubesql-3-04-2022 Jul 16, 2026
21 checks passed
@MazterQyou
MazterQyou deleted the cubesql/distinct-on branch July 16, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant