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

ParameterTypeRequiredDescription
arrayARRAY<ROW<T>>YesArray 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

Examples

Last update at: 2025/10/13 10:23:46