Skip to main content


Casting allows transforming data from one type to another. Each section on types describes the casts allowed for that data type.


Casting complex data structures

Both CAST and TRY_CAST can be used to cast the complex data structures. These castings are allowed as long as the casting is structurally compatible: i.e. records have the same field names, collections are casted to collections, and the inner types are castable to each other.

a := [(name: "Miguel", age: "39")]
CAST(a AS COLLECTION(RECORD(name: string, age: int))) // [(name: "Miguel", age: 39)]