[ 
https://issues.apache.org/jira/browse/CALCITE-5268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17635426#comment-17635426
 ] 

Brandon Chong commented on CALCITE-5268:
----------------------------------------

Thank you for the kind words and support :) I am very excited to work on this!
 * I added SqlParserTests
 * Added SqlValidatorTests
 ** For now we do not support ordinals in QUALIFY
 ** The code for ambiguous columns works in QUALIFY and rejects deptno without 
emp or dept prefix
 ** Non boolean expressions throw an error
 ** I added a check to make sure the the expression is a window function
 ** Can you give me an example of "applying windowed aggregate functions to 
aggregate functions"? 
 ** Mixing windowed and non windowed aggregates causes the query to fail
 * I added a test for Correlated Subqueries in SqlToRelConverter
 * Added a qualify.iq 
 * Updated reference.md

Please let me know anything else you would like to see :) 

> 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: 10m
>  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)

Reply via email to