UNWRAP_ONE
All functions > ARRAY_OF_ROWS > UNWRAP_ONE
Returns the value of the first field of the first element in an array of single-field rows.
Syntax
UNWRAP_ONE(array: ARRAY<ROW<T>>) → 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
Field type - Value of the first field from the first element
Notes
- Extracts the first field value from the first row in an array
- Only works with arrays of rows that have exactly one field
- Throws error if row has multiple fields
- Useful for unwrapping aggregation results