is_variant_null
function
Applies to: Databricks SQL Databricks Runtime 15.3 and later
Tests whether variantExpr
is a VARIANT
-encoded NULL
.
Syntax
is_variant_null ( variantExpr )
Arguments
variantExpr
: AVARIANT
expression to check if it isVARIANT
-encodedNULL
.
Returns
A BOOLEAN
.
Notes
This function checks whether the variantExpr
is storing a VARIANT
encoded NULL
.
Use the IS NULL operator to check if the input variantExpr
is NULL
.
Examples
-- Simple example
> SELECT is_variant_null(v:key), is_variant_null(v:a)
FROM VALUES(parse_json('{"key": null, "a": 1}')) AS T(v)
true false
-- difference between is_variant_null and is null
> SELECT is_variant_null(v:key), v:key IS NULL
FROM VALUES(parse_json('{"key": null}')) AS T(v)
true false