Collection Functions
Functions for working with complex data types like arrays/lists, maps, and structs.
Expands an array or list into a set of rows, where each row contains one element from the array/list. This typically changes the grain of the query, hence the KEY purpose.
Retrieves an element from an array or list using its zero-based integer index. Accessing an index outside the bounds may result in NULL or an error.
Retrieves the value associated with a specified key from a map. The key type must match the map's key type (usually STRING or INTEGER). Returns NULL if the key is not found.
Retrieves the value of a named field (attribute) from a struct. The second argument is the attribute name (string). Accessing a non-existent attribute may result in NULL or an error.
Constructs a struct (similar to a record or object) dynamically from pairs of arguments: field name (string literal) followed by the field value.
Constructs an array containing the provided arguments. All arguments should ideally be of a compatible type; behavior/support depends on target DB. The output type depends on the input argument types.
Returns an array containing all the keys in the input map.
Returns an array containing all the values in the input map.
Generates an array of numbers in a given range, with an optional step.
Returns an array with all duplicate values removed.
Sorts the elements of an array. The second argument specifies the sort order ('asc' or 'desc').
Applies a user defined function to each element of an array and returns a new array of the results. You must define the function prior to use.
Filters an array by applying a function to each element and, returning a new array with only the elements for which the function returns true. You must define the function prior to use.
Converts an array to a string, with elements separated by a given delimiter.
Computes the sum of all numeric elements in an array.
