[
https://issues.apache.org/jira/browse/DRILL-1040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mehant Baid resolved DRILL-1040.
--------------------------------
Resolution: Fixed
We currently don't have sum() implemented for decimal so we implicitly cast to
double. Postgres returns the same result when we cast the input to double.
> sum(decimal28) gives wrong result
> ---------------------------------
>
> Key: DRILL-1040
> URL: https://issues.apache.org/jira/browse/DRILL-1040
> Project: Apache Drill
> Issue Type: Bug
> Components: Functions - Drill
> Reporter: Chun Chang
> Assignee: Mehant Baid
>
> #Wed Jun 18 10:27:23 PDT 2014
> git.commit.id.abbrev=894037a
> sum(decimal28) gives wrong result.
> postgres:
> foodmart=# select sum(cast(c_decimal28 as decimal(28,9))) from data where
> c_row < 12;
> sum
> ---------------------
> 246925924.802356789
> drill:
> 0: jdbc:drill:schema=dfs> select sum(cast(c_decimal28 as decimal(28,9))) from
> data where c_row < 12;
> +------------+
> | EXPR$0 |
> +------------+
> | 2.46925952E8 |
--
This message was sent by Atlassian JIRA
(v6.2#6252)