ARRAY_FILTER

Learn how to use the ARRAY_FILTER array function in PlaidCloud Lakehouse. Constructs an array from those elements of the input array for which the lambda...

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

Analyze Syntax

func.array_filter( <array>, <lambda> )

Analyze Examples

func.array_filter([1, 2, 3], x -> (x > 1))

┌─────────────────────────────────────────────┐
 func.array_filter([1, 2, 3], x -> (x > 1))  
├─────────────────────────────────────────────┤
 [2,3]                                       
└─────────────────────────────────────────────┘

SQL Syntax

ARRAY_FILTER( <array>, <lambda> )

SQL Examples

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

┌───────────────────────────────────────┐
 array_filter([1, 2, 3], x -> (x > 1)) 
├───────────────────────────────────────┤
 [2,3]                                 
└───────────────────────────────────────┘