UNNEST accepts either 1 or 2 arguments. The optional key value argument allows for grouping the rows produced in the result table. This is especially helpful when using UNNEST as a complement of the ARRAY_AGG function, because ARRAY_AGG may be invoked with the aggregate GROUP BY clause to produce multiple ARRAY values based on the grouping.
The array_expr argument is an expression that evaluates to an ARRAY data type that is currently defined in the system.