You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Jacques Nadeau (JIRA)" <ji...@apache.org> on 2015/01/04 22:28:36 UTC

[jira] [Updated] (DRILL-910) to_number returns a float when when integer is expected.

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

Jacques Nadeau updated DRILL-910:
---------------------------------
    Fix Version/s:     (was: Future)
                   1.0.0
         Assignee: Jinfeng Ni  (was: Cliff Buchanan)
         Priority: Critical  (was: Major)

> to_number returns a float when when integer is expected.
> --------------------------------------------------------
>
>                 Key: DRILL-910
>                 URL: https://issues.apache.org/jira/browse/DRILL-910
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>            Reporter: Krystal
>            Assignee: Jinfeng Ni
>            Priority: Critical
>             Fix For: 1.0.0
>
>
> git.commit.id.abbrev=8490d74
> git.build.time=02.06.2014 @ 10\:11\:56 PDT
> 0: jdbc:drill:schema=dfs> select to_number('$987,966', '$###,###') from voter where voter_id=10;
> +------------+
> |   EXPR$0   |
> +------------+
> | 987966.0   |
> +------------+
> 0: jdbc:drill:schema=dfs> select to_number('2,900.55', '#,###') from voter where voter_id=10;
> +------------+
> |   EXPR$0   |
> +------------+
> | 2901.0     |
> +------------+
> In the first example, an int is passed to_number so we expect an in to return.  In the second example, the format in the second argument is to return an int.
> In both cases, postgres and oracle return an int. 



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