You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Jacques Nadeau (JIRA)" <ji...@apache.org> on 2014/06/18 06:26:09 UTC

[jira] [Commented] (DRILL-793) decimal arithmetic behavior

    [ https://issues.apache.org/jira/browse/DRILL-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14034796#comment-14034796 ] 

Jacques Nadeau commented on DRILL-793:
--------------------------------------

fixed in 894037a or earlier

> 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: DrillCommitter
>             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)