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

Mehant Baid updated DRILL-607:
------------------------------

    Attachment: DRILL-607.patch

> cast bigint as decimal(38,0) produces wrong results
> ---------------------------------------------------
>
>                 Key: DRILL-607
>                 URL: https://issues.apache.org/jira/browse/DRILL-607
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Chun Chang
>            Assignee: Mehant Baid
>         Attachments: DRILL-607.patch
>
>
> postgres:
> foodmart=# select cast(c_bigint as decimal(38,0)) from data;
>        c_bigint
> ----------------------
>                     0
>                     1
>                    -1
>                    12
>                   123
>  -9223372036854775808
>   9223372036854775807
>      4567890123456789
>     -4567890123456789
>       920320399049584
>   -922337203685477580
>             -99392039
>           -2147483648
>            2147483647
>                 32767
>                -32767
>                 49032
>              -4989385
>              69834830
>                   243
>               -426432
>                 -3904
>    922337203685477580
> (23 rows)
> drill:
> 0: jdbc:drill:schema=dfs> select cast(c_bigint as decimal(38,0)) from data;
> +------------+
> |   EXPR$0   |
> +------------+
> | 0          |
> | 1          |
> | -1         |
> | 12         |
> | 123        |
> | 0          |
> | 9          |
> | 4567890    |
> | -4567890   |
> | 920320     |
> | -922337203 |
> | -99392039  |
> | -2         |
> | 2          |
> | 32767      |
> | -32767     |
> | 49032      |
> | -4989385   |
> | 69834830   |
> | 243        |
> | -426432    |
> | -3904      |
> | 922337203  |
> +------------+
> 23 rows selected (0.121 seconds)



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

Reply via email to