HPL/SQL is included to Apache Hive since version 2.0
If the first expression is NOT NULL, NVL2 function returns the result of the second expression, otherwise it returns the result of the third expression.
NVL2(expr1, expr2, expr3);
|exprN||Any||Variable or expression|
The data type of the returned expression by expr2 or expr3 depending whether expr1 is NULL or not.
NVL2(NULL, 1, 2);
Compatibility: Oracle and IBM DB2.
Version: PL/HQL 0.01