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 "Alex Rodoni (JIRA)" <ji...@apache.org> on 2018/08/07 19:20:00 UTC
[jira] [Closed] (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:all-tabpanel ]
Alex Rodoni closed IMPALA-5839.
-------------------------------
Resolution: Fixed
Fix Version/s: Impala 3.1.0
> 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