ARRAY_REDUCE (Lakehouse v1)
Applies iteratively the lambda function to the elements of the array, so as to reduce the array to a single value.
Analyze Syntax
Section titled “Analyze Syntax”func.array_reduce( <array>, <lambda> )Analyze Examples
Section titled “Analyze Examples”func.array_reduce([1, 2, 3, 4], (x, y) -> (x + y))
┌─────────────────────────────────────────────────────┐│ func.array_reduce([1, 2, 3, 4], (x, y) -> (x + y)) │├─────────────────────────────────────────────────────┤│ 10 │└─────────────────────────────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”ARRAY_REDUCE( <array>, <lambda> )SQL Examples
Section titled “SQL Examples”SELECT ARRAY_REDUCE([1, 2, 3, 4], (x,y) -> x + y);
┌───────────────────────────────────────────────┐│ array_reduce([1, 2, 3, 4], (x, y) -> (x + y)) │├───────────────────────────────────────────────┤│ 10 │└───────────────────────────────────────────────┘