[
https://issues.apache.org/jira/browse/CALCITE-5268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17690627#comment-17690627
]
Brandon Chong commented on CALCITE-5268:
----------------------------------------
It looks great to me :)
And I learned some tricks with the RelBuilder API
> Add QUALIFY clause
> ------------------
>
> Key: CALCITE-5268
> URL: https://issues.apache.org/jira/browse/CALCITE-5268
> Project: Calcite
> Issue Type: New Feature
> Reporter: Brandon Chong
> Assignee: Brandon Chong
> Priority: Major
> Labels: pull-request-available
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> {{QUALIFY}} is to Window functions what {{HAVING}} is to {{GROUP BY}}.
> For example:
> {code}
> SELECT a, b, c, ROW_NUMBER() OVER (PARTITION BY b ORDER BY c) as row_num
> FROM t1
> QUALIFY row_num = 1
> {code}
> Is the same as:
> {code}
> SELECT *
> FROM (
> SELECT a, b, c, ROW_NUMBER() OVER (PARTITION BY b ORDER BY c) as row_num
> FROM t1)
> WHERE row_num = 1
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)