You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Mehant Baid (JIRA)" <ji...@apache.org> on 2014/06/11 20:44:01 UTC
[jira] [Resolved] (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 ]
Mehant Baid resolved DRILL-591.
-------------------------------
Resolution: Invalid
Casting varchar of the form '0.000001' to int errors out in Postgres as well. We need to use explicit cast to float followed by int.
> 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: 1.0.0-BETA1
>
>
> 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.2#6252)