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

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

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

IMPALA-7739 IMPALA-7740: [DOCS] Correct descriptions of NVL2 and DECODE

- Corrected the return values of the NVL2 function.
- Updated the DECODE section.
- Simplified the examples.

Change-Id: I7f6b9d56e85f7dffeb29218b244af1cc535dc03e
Reviewed-on: http://gerrit.cloudera.org:8080/11758
Reviewed-by: Paul Rogers <par0...@yahoo.com>
Reviewed-by: Alex Rodoni <arod...@cloudera.com>
Tested-by: Alex Rodoni <arod...@cloudera.com>


> Errata in documentation of decode() method
> ------------------------------------------
>
>                 Key: IMPALA-7739
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7739
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Docs
>    Affects Versions: Impala 3.0
>            Reporter: Paul Rogers
>            Assignee: Alex Rodoni
>            Priority: Minor
>             Fix For: Impala 3.1.0
>
>
> Consider the description of {{decode()}} in [the 
> docs|https://impala.apache.org/docs/build3x/html/topics/impala_conditional_functions.html].
>  Original text:
> {quote}
> decode(type expression, type search1, type result1 [, type search2, type 
> result2 ...] [, type default] )
> Purpose: Compares an expression to one or more possible values, and returns a 
> corresponding result when a match is found.
> 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
> Usage notes:
> * Can be used as shorthand for a CASE expression.
> * The original expression and the search expressions must of the same type or 
> convertible types. * The result expression can be a different type, but all 
> result expressions must be of the same type.
> * Returns a successful match If the original expression is NULL and a search 
> expression is also NULL. the
> * Returns NULL if the final default value is omitted and none of the search 
> expressions match the original expression.
> {quote}
> Revise:
> * Remove “type” prefix for arguments (here and in all functions), it really 
> adds no value and is actually confusing because the argument is not a type, 
> it is a value.
> * Usage notes: Comparison is done using the IS NOT DISTINCT (<=>) operator: 
> this NULL can be used as a search condition.
> * Since this is a list, great between the two items in the second item in 
> usage.
> * The third item has a dangling “the” at the end.
> * Reword the fourth item: “If none of the search expressions match the 
> expression, then returns the default (if given) or NULL (if no default is 
> given.)”
> Suggested revised text:
> Purpose: Compares an expression to one or more possible values using the IS 
> NOT DISTINCT operator, and returns a corresponding result when a match is 
> found.
> Usage notes:
> * Can be used as shorthand for a CASE expression.
> * The expression and the search expressions must of the same type or 
> convertible types.
> * The result expression can be a different type, but all result expressions 
> must be of the same type.
> * Returns a successful match If the original expression is NULL and a search 
> expression is also NULL. (Uses IS NOT DISTINCT to do the comparison.)
> * NULL can be used as a search expression.
> * Returns NULL if the final default value is omitted and none of the search 
> expressions match the original expression.



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

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

Reply via email to