You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Sudheesh Katkam (JIRA)" <ji...@apache.org> on 2015/07/15 02:04:05 UTC

[jira] [Closed] (DRILL-591) explicit cast fail to convert 0.00000001 to int

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

Sudheesh Katkam closed DRILL-591.
---------------------------------

> explicit cast fail to convert 0.00000001 to int
> -----------------------------------------------
>
>                 Key: DRILL-591
>                 URL: https://issues.apache.org/jira/browse/DRILL-591
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>            Reporter: Chun Chang
>            Assignee: Sudheesh Katkam
>             Fix For: 0.4.0
>
>
> The following number can be converted to int 0 on postgres:
> foodmart=# select c_decimal9 from data where c_row =6;
>  c_decimal9
> ------------
>  0.00000001
> (1 row)
> foodmart=# select cast(c_decimal9 as int) from data where c_row = 6;
>  c_decimal9
> ------------
>           0
> (1 row)
> But with Drill, it fails:
> 0: jdbc:drill:schema=dfs> select cast(c_decimal9 as varchar(20)) from data where c_row =6;
> +------------+
> |   EXPR$0   |
> +------------+
> | 0.00000001 |
> +------------+
> 1 row selected (0.117 seconds)
> 0: jdbc:drill:schema=dfs> select cast(c_decimal9 as int) from data where c_row = 6;
> Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while running query.[error_id: "ae039e8f-1c9a-435c-92fe-d4f0b7614cb8"
> endpoint {
>   address: "qa-node118.qa.lab"
>   user_port: 31010
>   control_port: 31011
>   data_port: 31012
> }
> error_type: 0
> message: "Failure while running fragment. < NumberFormatException:[ 0.00000001 ]"
> ]
> Error: exception while executing query (state=,code=0)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)