Skip to main content

Collections

Construction

Collections contain any number of elements of the same type (or null).

ExampleTypeRemarks
collection(<expression>, …)collection(1, 2, 3)collection(int not nullable)Collection with three integers.
[<expression>, …][1, 2.0, null]collection(double nullable)Collection of doubles since 2.0 is a double.

Operations

Comparisons

Collections cannot be compared with equality operators =, <>, etc. However, collections can be compared using IS DISTINCT FROM / IS NOT DISTINCT FROM as described in Comparisons.

Casts

Collections can be casted to other collections, as long as the inner types are also castable.

Example
cast(collection(1, 2) as collection(float)) // collection(1f, 2f)
cast([(a: 1)] as collection(record(a: string)) ) // [(a: "1")]