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

Julian Hyde commented on CALCITE-1445:
--------------------------------------

Test case: https://github.com/julianhyde/calcite/tree/1445-sequence-next-value

> Calls to NEXT VALUE FOR sequence should return different results
> ----------------------------------------------------------------
>
>                 Key: CALCITE-1445
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1445
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>
> Calls to NEXT VALUE FOR sequence should return different results. Currently, 
> the calls are combined by the planner, so the results are the same.
> {code}
> select *
> from (
>   select *
>   from (values 1, 2) as t (c)
>   where next value for "my_seq" > 10)
> where next value for "my_seq" < 10;
> {code}
> yields plan
> {code}
> EnumerableCalc(expr#0=[{inputs}], expr#1=['"my_seq"'], 
> expr#2=[NEXT_VALUE($t1)], expr#3=[10], expr#4=[>($t2, $t3)], expr#5=[<($t2, 
> $t3)], expr#6=[AND($t4, $t5)], EXPR$0=[$t0], $condition=[$t6])
>   EnumerableValues(tuples=[[{ 1 }, { 2 }]])
> {code}
> [~jamestaylor], [~maryannxue], Is this the behavior you would like/expect in 
> Phoenix?



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

Reply via email to