You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/08/07 21:33:00 UTC

[jira] [Commented] (IMPALA-5839) nullifzero and zeroifnull documentation about return type doesn't match implementation

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

ASF subversion and git services commented on IMPALA-5839:
---------------------------------------------------------

Commit 22f167f542edb6a73e4c4e5350e788f6bf2683cb in impala's branch refs/heads/master from [~arodoni_cloudera]
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=22f167f ]

IMPALA-5839: [DOCS] Corrected the return types for NULLIFZERO and NULLIFZERO

Change-Id: Ia7927a5caf1d200a1f4d04d3729c29391c7f43cd
Reviewed-on: http://gerrit.cloudera.org:8080/11024
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> nullifzero and zeroifnull documentation about return type doesn't match implementation
> --------------------------------------------------------------------------------------
>
>                 Key: IMPALA-5839
>                 URL: https://issues.apache.org/jira/browse/IMPALA-5839
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Docs
>            Reporter: Philip Zeyliger
>            Assignee: Alex Rodoni
>            Priority: Major
>             Fix For: Impala 3.1.0
>
>
> https://impala.incubator.apache.org/docs/build/html/topics/impala_conditional_functions.html mentions return types of {{nullifzero}} and {{zeroifnull}}:
> {quote}
> nullifzero(numeric_expr)
> Return type: same as the initial argument value, except that integer values are promoted to BIGINT and floating-point values are promoted to DOUBLE; use CAST() when inserting into a smaller numeric column
> zeroifnull(numeric_expr)
> Return type: same as the initial argument value, except that integer values are promoted to BIGINT and floating-point values are promoted to DOUBLE; use CAST() when inserting into a smaller numeric column
> {quote}
> However, I see it returning the underlying type without promotion.
> {code}
> [...:21000] > select typeof(nullifzero(1)), typeof(zeroifnull(cast(1 as integer)));
> ...
> +-----------------------+------------------------------------+
> | typeof(nullifzero(1)) | typeof(zeroifnull(cast(1 as int))) |
> +-----------------------+------------------------------------+
> | TINYINT               | INT                                |
> +-----------------------+------------------------------------+
> Fetched 1 row(s) in 0.02s
> {code}
> I suspect the docs are wrong here.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org