Skip to main content

ARRAY_FILTER

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

Syntax

ARRAY_FILTER( <array>, <lambda> )

Examples

SELECT ARRAY_FILTER([1, 2, 3], x -> x > 1);

┌───────────────────────────────────────┐
│ array_filter([1, 2, 3], x -> (x > 1))
├───────────────────────────────────────┤
[2,3]
└───────────────────────────────────────┘
Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today