<value>: The expression collected into the array. Its result type becomes the element type of the returned array.
Optional
DISTINCT: Keeps only distinct values. When you use DISTINCT, the ORDER BY expression (including its collation) must match <value>.
ORDER BY <sort_expression> [, ...]: Orders the elements within the array (an aggregate-local ordering). Each sort key accepts ASC / DESC and NULLS FIRST / NULLS LAST.
NULL ON NULL: Collects NULL inputs as NULL array elements. This is the default.
ABSENT ON NULL: Skips NULL inputs so they don’t appear in the array.
Returns
An array whose element type matches <value>.
Null handling:
With the default NULL ON NULL, NULL inputs are kept as NULL array elements.
With ABSENT ON NULL, NULL inputs are dropped. A group whose values are all NULL returns an empty array ([]).