You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Chun Chang (JIRA)" <ji...@apache.org> on 2014/05/21 02:32:38 UTC

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

Chun Chang created DRILL-793:
--------------------------------

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