You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Vignesh Raghunathan (JIRA)" <ji...@apache.org> on 2016/10/13 00:18:20 UTC

[jira] [Created] (ASTERIXDB-1692) Case statement referring to aggregated value throws ArrayIndexOutOfBoundsException

Vignesh Raghunathan created ASTERIXDB-1692:
----------------------------------------------

             Summary: 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


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)