Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Impala 3.0
-
None
-
ghx-label-8
Description
Impala offers the NVL2() function from Oracle. A clearer definition is here:
The syntax for the NVL2 function in Oracle/PLSQL is:
NVL2( string1, value_if_not_null, value_if_null )
Contrast that with the Impala description:
Enhanced variant of the nvl() function. Tests an expression and returns different result values depending on whether it is NULL or not. If the first argument is NULL, returns the second argument. If the first argument is not NULL, returns the third argument. Equivalent to the nvl2() function from Oracle Database.
(Emphasis added.) The description is exactly backward. To see this:
select n, nvl2(n, 10, 20) from ints; +------+---------------------------+ | n | if(n is not null, 10, 20) | +------+---------------------------+ | NULL | 20 | | 0 | 10 | +------+---------------------------+
Hence, the implementation follows Oracle, the documentation is wrong.
Attachments
Issue Links
- is part of
-
IMPALA-7747 Clean up the Expression Rewriter
-
- Open
-