JSON_STRIP_NULLS (Lakehouse v1)
Remove todas as propriedades com valores nulos de um objeto JSON.
Sintaxe do Analyze
Seção intitulada “Sintaxe do Analyze”func.json_strip_nulls(<json_string>)Exemplos do Analyze
Seção intitulada “Exemplos do Analyze”func.json_strip_nulls(func.parse_json('{"name": "alice", "age": 30, "city": null}'))
┌─────────────────────────────────────────────────────────────────────────────────────────────────┐│ func.json_strip_nulls(func.parse_json('{"name": "alice", "age": 30, "city": null}')) ││ String │├─────────────────────────────────────────────────────────────────────────────────────────────────┤│ {"age":30,"name":"Alice"} │└─────────────────────────────────────────────────────────────────────────────────────────────────┘Sintaxe SQL
Seção intitulada “Sintaxe SQL”JSON_STRIP_NULLS(<json_string>)Tipo de retorno
Seção intitulada “Tipo de retorno”Retorna um valor do mesmo tipo que o valor JSON de entrada.
Exemplos de SQL
Seção intitulada “Exemplos de SQL”SELECT JSON_STRIP_NULLS(PARSE_JSON('{"name": "Alice", "age": 30, "city": null}'));
json_strip_nulls(parse_json('{"name": "alice", "age": 30, "city": null}'))|--------------------------------------------------------------------------+{"age":30,"name":"Alice"} |