Vignesh Raghunathan created ASTERIXDB-1692:

             Summary: Case statement referring to aggregated value throws 
                 Key: ASTERIXDB-1692
             Project: Apache AsterixDB
          Issue Type: Bug
         Environment: Master branch with latest commit 
            Reporter: Vignesh Raghunathan

To reproduce the issue, run the following SQL++ statements:

drop dataverse sampdb if exists;
create dataverse sampdb;
use sampdb;

create type samptabletype as closed {
  id1: 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);


4 [ArrayIndexOutOfBoundsException]

This message was sent by Atlassian JIRA

Reply via email to