Returns a new array containing only the elements for which the provided lambda expression returns true.
Syntax
1ARRAY_FILTER(<array>, <lambda>)
Arguments
Required
<array>: The input array to filter.
<lambda>: A lambda expression that takes one parameter and returns a boolean value. Elements for which the lambda returns true are included in the result.
Returns
Returns an array containing only the elements where the lambda expression evaluated to true. Returns NULL if the input array is NULL. Returns an empty array if no elements match the condition.
Considerations
The lambda expression must return a boolean value. Non-boolean return types result in an error.
The lambda can’t reference columns or variables from the outer query scope.
The order of elements in the result matches their order in the input array.