[ https://issues.apache.org/jira/browse/CALCITE-5268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17684971#comment-17684971 ]
Brandon Chong commented on CALCITE-5268: ---------------------------------------- [~julianhyde] Sorry for dropping the ball on this. I got context switched and also went on vacation. I seemed to get the PR passing with some minor code smells. Can you let me know what is needed to get this over the line? Thank you! > 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: 0.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)