drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mehant Baid (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DRILL-793) decimal arithmetic behavior
Date Tue, 17 Jun 2014 07:38:01 GMT

     [ https://issues.apache.org/jira/browse/DRILL-793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mehant Baid updated DRILL-793:
------------------------------

    Attachment: DRILL-793.patch

> decimal arithmetic behavior
> ---------------------------
>
>                 Key: DRILL-793
>                 URL: https://issues.apache.org/jira/browse/DRILL-793
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>            Reporter: Chun Chang
>            Assignee: Mehant Baid
>             Fix For: 1.0.0-BETA1
>
>         Attachments: DRILL-793.patch
>
>
> How do we decide what significant digits to use when mix different decimals in arithmetic
calculations? Current implementation is to use numerator as reference, this might not be optimal.
Here is an example:
> drill:
> 0: jdbc:drill:schema=dfs> select cast('123456789' as decimal(9,0)) / cast('12345678901234.56789123456789'
as decimal(28,14)) from data limit 1;
> +------------+
> |   EXPR$0   |
> +------------+
> | 0          |
> +------------+
> postgres:
> foodmart=# select cast('123456789' as decimal(9,0)) / cast('12345678901234.56789123456789'
as decimal(28,14)) from data limit 1;
>           ?column?
> ----------------------------
>  0.000009999999998999999999
> (1 row)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message