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/04/29 23:31:16 UTC

[jira] [Commented] (DRILL-593) can't convert int value -2147483648 to decimal(28,8)

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

Chun Chang commented on DRILL-593:
----------------------------------

with postgres, the conversion worked:

foodmart=# select c_row, cast(c_int as decimal(28,8)) from data where c_row = 9;
 c_row |        c_int
-------+----------------------
     9 | -2147483648.00000000
(1 row)

foodmart=# select c_row, c_int from data where c_row = 9;
 c_row |    c_int
-------+-------------
     9 | -2147483648
(1 row)

With Drill, the conversion give wrong result:

0: jdbc:drill:schema=dfs> select c_row, c_int from data where c_row = 9;
+------------+------------+
|   c_row    |   c_int    |
+------------+------------+
| 9          | -2147483648 |
+------------+------------+
1 row selected (0.199 seconds)
0: jdbc:drill:schema=dfs> select c_row, cast(c_int as decimal(28,8)) from data where c_row = 9;
+------------+------------+
|   c_row    |   EXPR$1   |
+------------+------------+
| 9          | 0E-8       |
+------------+------------+

> can't convert int value -2147483648 to decimal(28,8)
> ----------------------------------------------------
>
>                 Key: DRILL-593
>                 URL: https://issues.apache.org/jira/browse/DRILL-593
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Chun Chang
>




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