FLATTEN_FUNC
All functions > ARRAY > FLATTEN_FUNC
Flattens a nested array structure into a single-level array.
Syntax
FLATTEN_FUNC(array: ARRAY<ARRAY<T>>) → ARRAY<T> sql
Type Parameters:
T: Any type
Arguments
| Parameter | Type | Required | Description |
|---|---|---|---|
array | ARRAY<ARRAY<T>> | Yes | Nested array (array of arrays) to flatten |
Returns
Array(T) - Single-level array with all nested elements
Notes
- Flattens one level of nesting
- Preserves element order
- Generic type: Array(Array(T)) → Array(T)
- Works with any array element type
- Empty nested arrays are removed from result