ifnull
function
Applies to: Databricks SQL
Databricks Runtime
Returns expr2
if expr1
is NULL
, or expr1
otherwise. This function is a synonym for coalesce(expr1, expr2)
with two arguments.
ifnull(expr1, expr2)
expr1
: An expression of any type.expr2
: An expression sharing a least common type withexpr1
.
The result type is the least common type of expr1
and expr2
.
> SELECT ifnull(NULL, array('2'));
[2]