drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacques Nadeau (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-910) to_number returns a float when when integer is expected.
Date Mon, 16 Jun 2014 20:46:05 GMT

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

Jacques Nadeau commented on DRILL-910:
--------------------------------------

The problem here is that this requires us binding to different function implementations and
data types depending on the format string.  We do this as part of the CONVERT_TO/CONVERT_FROM
functions but nowhere else.  As such, we don't have a generalized infrastructure to support
this behavior.  Moving to future.

> 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: Cliff Buchanan
>             Fix For: Future
>
>
> 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.2#6252)

Mime
View raw message