- Returns
TRUEif any element in the array isTRUE. - Returns
FALSEif all elements in the array areFALSEor if the array is empty. - Returns
NULLif any element isNULLand no element isTRUE.
ARRAY_ANY_MATCH applies the function to each element and then evaluates the resulting arrayt.
Alias: ANY_MATCH
Syntax
Parameters
| Parameter | Description | Supported input types |
|---|---|---|
<expression> | A lambda function applied to each element of the input arrays, returning a BOOLEAN. If no lambda function is provided, the function can only evaluate a single BOOLEAN array. For more information, see Manipulating arrays with Lambda functions. | Same as the element data types of the input arrays. |
<condition> | A BOOLEAN expression that evaluates each array value using a comparison operator. | See Comparison operators. |
<array> | The array to evaluate. | ARRAY |
Return Types
TheARRAY_ANY_MATCH function returns a result of type BOOLEAN.
Examples
Example The following code example checks if an array contains the valueesimpson as the result is_he_playing:
FALSE because the array does not contain the specified value:
| is_he_playing (BOOLEAN) |
|---|
| f |
divisible:
TRUE because each element in the first array is divisible by its corresponding element in the second array:
| divisible (BOOLEAN) |
|---|
| t |
ARRAY_ANY_MATCH:
FALSE for the empty array, TRUE for the [TRUE] array, FALSE for the [FALSE] array, NULL for the [NULL] array, and FALSE for the [FALSE, NULL] array:
| empty (BOOLEAN) | single_true (BOOLEAN) | single_false (BOOLEAN) | single_null (BOOLEAN) | false_and_null (BOOLEAN) |
|---|---|---|---|---|
| f | t | f | NULL | NULL |