You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Uwe Geercken (JIRA)" <ji...@apache.org> on 2015/07/31 16:45:05 UTC

[jira] [Created] (DRILL-3586) Sum of values not correctly calculated

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)