You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "David Wayne Birdsall (JIRA)" <ji...@apache.org> on 2019/03/11 18:42:00 UTC

[jira] [Created] (TRAFODION-3284) SUM aggregate overflow criteria are inconsistent with rest of product

David Wayne Birdsall created TRAFODION-3284:
-----------------------------------------------

             Summary: SUM aggregate overflow criteria are inconsistent with rest of product
                 Key: TRAFODION-3284
                 URL: https://issues.apache.org/jira/browse/TRAFODION-3284
             Project: Apache Trafodion
          Issue Type: Bug
            Reporter: David Wayne Birdsall
            Assignee: David Wayne Birdsall


The following script demonstrates the problem:
{quote}drop table if exists t;

create table t (
c1 float,
c2 double precision,
c3 float,
c4 double precision
);

insert into t values (-1.234, -1.234, -1.42085740198313120E-309, -1.42085740198313120E-309);
select * from t;

select avg(c1) from t;
select avg(c2) from t;
select avg(c3) from t;
select avg(c4) from t;

select count(c1) from t;
select count(c2) from t;
select count(c3) from t;
select count(c4) from t;

select max(c1) from t;
select max(c2) from t;
select max(c3) from t;
select max(c4) from t;

select min(c1) from t;
select min(c2) from t;
select min(c3) from t;
select min(c4) from t;

select stddev(c1) from t;
select stddev(c2) from t;
select stddev(c3) from t;
select stddev(c4) from t;

select sum(c1) from t;
select sum(c2) from t;
select sum(c3) from t;
select sum(c4) from t;

select variance(c1) from t;
select variance(c2) from t;
select variance(c3) from t;
select variance(c4) from t;
{quote}
 

When run, the AVG, SUM, STDDEV and VARIANCE aggregates report error 8411 (floating point overflow) on columns C3 and C4. For STDDEV and VARIANCE this is correct, since calculating these aggregates requires squaring the column value. For SUM and AVG, we are merely summing the value, which should not cause an overflow.



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