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

Julian Hyde commented on CALCITE-2625:
--------------------------------------

The SqlWindow.framingAllowed member doesn't make any sense; you should remove 
it. In {{SqlImplementor.Context.toSql(RexProgram program, RexOver rexOver)}}, 
look at {{sqlAggregateFunction.allowsFraming()}} and wipe out the upper and 
lower bound if framing is not allowed.

In summary, there's nothing wrong with how SqlWindow is printing itself, the 
problem is in to RelToSql converts RexNode into SqlWindow.

> ROW_NUMBER, RANK generating Invalid SQL
> ---------------------------------------
>
>                 Key: CALCITE-2625
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2625
>             Project: Calcite
>          Issue Type: Bug
>          Components: jdbc-adapter
>            Reporter: KrishnaKant Agrawal
>            Assignee: Julian Hyde
>            Priority: Major
>
> The SQL standard says:- 
> If <ntile function>, <lead or lag function>, <rank function type> or 
> ROW_NUMBER is specified, then: … The window framing clause of WDX shall not 
> be present.
> So, Calcite should not print the Window Frames when such functions are used.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to