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

Chun Chang commented on DRILL-793:
----------------------------------

this was tested on

git.commit.id.abbrev=5d7e3d3

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

Reply via email to