[ 
https://issues.apache.org/jira/browse/ASTERIXDB-1692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yingyi Bu reassigned ASTERIXDB-1692:
------------------------------------

    Assignee: Yingyi Bu

> Case statement referring to aggregated value throws 
> ArrayIndexOutOfBoundsException
> ----------------------------------------------------------------------------------
>
>                 Key: ASTERIXDB-1692
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1692
>             Project: Apache AsterixDB
>          Issue Type: Bug
>         Environment: Master branch with latest commit 
> 76a4f9e36e841d9325bedb3bb96e7
>            Reporter: Vignesh Raghunathan
>            Assignee: Yingyi Bu
>
> To reproduce the issue, run the following SQL++ statements:
> {code}
> drop dataverse sampdb if exists;
> create dataverse sampdb;
> use sampdb;
> create type samptabletype as closed {
>   id1: int8,
>   id2:int8?
> };
> create dataset samptable1(samptabletype) primary key id1;
> insert into samptable1 ({'id1' : 1, 'id2':5});
> insert into samptable1 ({'id1' : 2, 'id2':10});
> with st1 as (
> select id1, sum(id2) id2sum
> from samptable1
> group by id1)
> select *
> from st1
> where (case when id2sum > 5 then (id2sum/id2sum) = 1 else true end);
> {code}
> Result:
> {code}
> 4 [ArrayIndexOutOfBoundsException]
> {code}



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

Reply via email to