nanvl
function
Applies to: Databricks SQL
Databricks Runtime
Returns expr1
if it's not NaN
, or expr2
otherwise.
nanvl(expr1, expr2)
expr1
: An expression that evaluates to a numeric.expr2
: An expression that evaluates to a numeric.
A DOUBLE.
> SELECT nanvl(cast('NaN' AS DOUBLE), 123);
123.0