UNWRAP
All functions > ARRAY_OF_ROWS > UNWRAP
Returns the first field values from an array of single-field rows as a simple array.
Syntax
UNWRAP(array: ARRAY<ROW<T>>) → ARRAY<T>
sql
Type Parameters:
T
: Any type - the type of the single field in the row
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
array | ARRAY<ROW<T>> | Yes | Array of single-field rows |
Returns
ARRAY - Simple array of field values
Notes
- Extracts the first field from each row in the array
- Only works with arrays of rows that have exactly one field
- Throws error if rows have multiple fields
- Useful for converting aggregation results to simple arrays