Ir al contenido

Comprueba si el valor de entrada es un null de JSON. Tenga en cuenta que esta función examina el null de JSON, no el NULL de SQL. Para comprobar si un valor es NULL de SQL, utilice IS_NULL.

JSON null Example:
{
"name": "John",
"age": null
}
func.is_null_value(<expr>)
func.is_null_value(func.get_path(func.parse_json('{"k1":[0,1,2], "k2":{"k3":3,"k4":4}}'), 'k2.k5'))
┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ func.is_null_value(func.get_path(func.parse_json('{"k1":[0,1,2], "k2":{"k3":3,"k4":4}}'), 'k2.k5')) │
├─────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ true │
└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
IS_NULL_VALUE( <expr> )

Devuelve true si el valor de entrada es un null de JSON y false en caso contrario.

SELECT
IS_NULL_VALUE(PARSE_JSON('{"name":"John", "age":null}') :age), --JSON null
IS_NULL(NULL); --SQL NULL
┌──────────────────────────────────────────────────────────────────────────────┐
│ is_null_value(parse_json('{"name":"john", "age":null}'):age) │ is_null(null) │
├──────────────────────────────────────────────────────────────┼───────────────┤
│ true │ true │
└──────────────────────────────────────────────────────────────────────────────┘