JSON_ARRAY_OVERLAP (Lakehouse v1)
Verifica se existe alguma sobreposição entre duas matrizes JSON e devolve true se houver elementos comuns; caso contrário, devolve false.
Sintaxe SQL
Seção intitulada “Sintaxe SQL”JSON_ARRAY_OVERLAP(<json_array1>, <json_array2>)Tipo de retorno
Seção intitulada “Tipo de retorno”A função devolve um valor booleano:
truese existir pelo menos um elemento comum às duas matrizes JSON,falsese não existirem elementos comuns.
Exemplos de SQL
Seção intitulada “Exemplos de SQL”SELECT json_array_overlap( '["apple", "banana", "cherry"]'::JSON, '["banana", "kiwi", "mango"]'::JSON);
-[ RECORD 1 ]-----------------------------------json_array_overlap('["apple", "banana", "cherry"]'::VARIANT, '["banana", "kiwi", "mango"]'::VARIANT): true
SELECT json_array_overlap( '["grape", "orange"]'::JSON, '["apple", "kiwi"]'::JSON);
-[ RECORD 1 ]-----------------------------------json_array_overlap('["grape", "orange"]'::VARIANT, '["apple", "kiwi"]'::VARIANT): false