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

Julian Hyde commented on CALCITE-5268:
--------------------------------------

I made some fix-ups in my 
[julianhyde/5268-qualify|https://github.com/julianhyde/calcite/tree/5268-qualify]
 branch before I noticed that you have lint errors, compilation errors, test 
failures.

[~bchong95], Can you start from my branch, and add commits to get the build 
running clean (compile, no lint errors, tests all pass)?

In a few cases, you added methods to the end of an existing class. Please don't 
do that. If other people do that, we are likely to get merge conflicts. It's 
better to put the methods in the most logical place (QUALIFY methods should 
probably be near to those for HAVING or WINDOW). Same goes for test methods and 
resources.

When tests fail, it's nice to get a precise line number. So I broke up some 
large test methods into smaller tests, and I expanded some tests that were 
using a {{for}} loop to iterate.

> 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