[ https://issues.apache.org/jira/browse/TRAFODION-3284?focusedWorklogId=211235&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-211235 ]
ASF GitHub Bot logged work on TRAFODION-3284: --------------------------------------------- Author: ASF GitHub Bot Created on: 11/Mar/19 19:34 Start Date: 11/Mar/19 19:34 Worklog Time Spent: 10m Work Description: DaveBirdsall commented on pull request #1812: [TRAFODION-3284] Make overflow processing for float SUM consistent URL: https://github.com/apache/trafodion/pull/1812 This change makes overflow checking on floating point datatypes for SUM (and AVG) consistent with floating point overflow checking elsewhere in the product. To do so required inlining certain code in order to not regress performance. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 211235) Time Spent: 10m Remaining Estimate: 0h > 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 > Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > 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)