Skip to content

Constructs an array from those elements of the input array for which the lambda function returns true.

func.array_filter( <array>, <lambda> )
func.array_filter([1, 2, 3], x -> (x > 1))
┌─────────────────────────────────────────────┐
│ func.array_filter([1, 2, 3], x -> (x > 1)) │
├─────────────────────────────────────────────┤
[2,3]
└─────────────────────────────────────────────┘
ARRAY_FILTER( <array>, <lambda> )
SELECT ARRAY_FILTER([1, 2, 3], x -> x > 1);
┌───────────────────────────────────────┐
│ array_filter([1, 2, 3], x -> (x > 1)) │
├───────────────────────────────────────┤
│ [2,3] │
└───────────────────────────────────────┘