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-1007) decimal38 comparison with double failed on some values
Date Wed, 18 Jun 2014 06:26:02 GMT

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

Mehant Baid updated DRILL-1007:
-------------------------------

    Assignee: DrillCommitter  (was: Mehant Baid)

> decimal38 comparison with double failed on some values
> ------------------------------------------------------
>
>                 Key: DRILL-1007
>                 URL: https://issues.apache.org/jira/browse/DRILL-1007
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>            Reporter: Chun Chang
>            Assignee: DrillCommitter
>         Attachments: DRILL-1007.patch
>
>
> comparison between double and decimal38 fails for some values like:
> 0 vs -0.000000010000000000
> -56789012345.1234 vs -999999999999999999.000000000000000000
> For example, the following query yields the following results with postgres:
> foodmart=# select c_row, c_float8, cast(c_decimal38 as decimal(38,18)) from data where
c_row < 15 and c_float8 > cast(c_decimal38 as decimal(38,18));
>  c_row |     c_float8      |              c_decimal38
> -------+-------------------+----------------------------------------
>      1 |              10.5 |                   0.000000000000000000
>      2 |              10.5 |                   1.000000000000000000
>      4 |   123456789012345 |           999999999.000000000000000000
>      5 |   999999999999999 |          -999999999.000000000000000000
>      7 |                 0 |                  -0.000000010000000000
>     11 | -56789012345.1234 | -999999999999999999.000000000000000000
>     13 |        2147483647 |                  -0.000000000000000010
> (7 rows)
> with Drill, two rows are missing due to failed comparison:
> 0: jdbc:drill:schema=dfs> select c_row, c_float8, cast(c_decimal38 as decimal(38,18))
from data where c_row < 15 and c_float8 > cast(c_decimal38 as decimal(38,18));
> +------------+------------+------------+
> |   c_row    |  c_float8  |   EXPR$2   |
> +------------+------------+------------+
> | 1          | 10.5       | 0E-18      |
> | 2          | 10.5       | 1.000000000000000000 |
> | 4          | 1.23456789012345E14 | 999999999.000000000000000000 |
> | 5          | 9.99999999999999E14 | -999999999.000000000000000000 |
> | 13         | 2.147483647E9 | -1.0E-17   |
> +------------+------------+------------+
> 5 rows selected (0.156 seconds)



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

Mime
View raw message