db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Boynes (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-131) AVG precision is INTEGER instead of DOUBLE
Date Mon, 24 Jan 2005 19:50:17 GMT
     [ http://issues.apache.org/jira/browse/DERBY-131?page=comments#action_58013 ]
Jeremy Boynes commented on DERBY-131:

I think what we are doing here currently is compatible. According to the spec, if the datatype
is an exact numeric then the result is also an exact numeric. So in this case returning a
DOUBLE would be incorrect as we would be converting the exact numeric INTEGER to an approximate

The precision returned is implementation-defined. Derby defines this to be the precision of
the original datatype, which in the absence of additional information seems reasonable as
you can specify the output type by casting the input appropriately (although arguably the
performance of the aggregation may be impacted if you sum as DECIMAL rather than as an INTEGER)

> AVG precision is INTEGER instead of DOUBLE
> ------------------------------------------
>          Key: DERBY-131
>          URL: http://issues.apache.org/jira/browse/DERBY-131
>      Project: Derby
>         Type: Bug
>   Components: SQL
>     Versions:
>     Reporter: Rainer Gemulla

> The AVG aggregator returns an INTEGER value, if the data tyoe of the respective attribute
is INTEGER. This is wrong, because the average of a set of integers is not always an integer,

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
If you want more information on JIRA, or have a bug to report see:

View raw message