JSON_ARRAY_OVERLAP (Lakehouse v1)
Vérifie si deux tableaux JSON ont des éléments en commun et renvoie true si c’est le cas, sinon false.
Syntaxe SQL
Section intitulée « Syntaxe SQL »JSON_ARRAY_OVERLAP(<json_array1>, <json_array2>)Type de retour
Section intitulée « Type de retour »La fonction renvoie une valeur booléenne :
trues’il existe au moins un élément commun aux deux tableaux JSON,falses’il n’existe aucun élément commun.
Exemples SQL
Section intitulée « Exemples 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