drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Geercken (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-3586) Sum of values not correctly calculated
Date Fri, 31 Jul 2015 14:45:05 GMT
Uwe Geercken created DRILL-3586:
-----------------------------------

             Summary: Sum of values not correctly calculated
                 Key: DRILL-3586
                 URL: https://issues.apache.org/jira/browse/DRILL-3586
             Project: Apache Drill
          Issue Type: Bug
          Components: Execution - Data Types
    Affects Versions: 1.1.0
            Reporter: Uwe Geercken
            Assignee: Hanifi Gunes


I have a column "value" containing numeric values only - but the column was defined as String
when creating the parquet files using the CTAS statement.

I have 163 records being returned from the query. When I run a sum on the values like this
- cast to double:

select count(1),sum(cast(`value` as double)) as total from dfs.datatransfer.<tablename>
where key_account_id='xxxxx'

then the result is: 213.42000000000002

when I cast to float instead:

select count(1),sum(cast(`value` as float)) as total from dfs.datatransfer.<tablename>
where key_account_id='xxxxx'

then the result is: 213.4200000166893

summing up the values in the original system (MySQL) then the real and correct sum is: 213.42.

I checked the data manually and the sum from the origin system is correct.





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message