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

Vladimir Sitnikov commented on CALCITE-806:
-------------------------------------------

[~julianhyde], I do not agree with your analysis quite yet.

My bet is parsing/sqltorel translation is wrong.

`ROW_NUMBER() over ()` is translated to `ROW_NUMBER() over (BETWEEN UNBOUNDED 
PRECEDING AND UNBOUNDED FOLLOWING)`.

I'm puzzled what is the best way to solve that.

I would suggest unconditionally rewrite `ROW_NUMBER`'s bounds to `ROWS BETWEEN 
UNBOUNDED PRECEDING AND CURRENT ROW`.


> ROW_NUMBER should emit distinct values
> --------------------------------------
>
>                 Key: CALCITE-806
>                 URL: https://issues.apache.org/jira/browse/CALCITE-806
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>             Fix For: next
>
>
> ROW_NUMBER should emit distinct values even for rows that have identical sort 
> keys, or if there is no sort key. (This is distinct from RANK and DENSE_RANK, 
> which emit the same value for rows with the same sort key.)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to