all_match
Returns whether all elements of an array match the given predicate. Returns true if all the elements match the predicate (a special case is when the array is empty); false if one or more elements donβt match; NULL if the predicate function returns NULL for one or more elements and true for all other elements.
Supported Signatures
any_match
Returns whether any elements of an array match the given predicate. Returns true if one or more elements match the predicate; false if none of the elements matches (a special case is when the array is empty); NULL if the predicate function returns NULL for one or more elements and false for all other elements.
Supported Signatures
array_distinct
Remove duplicate values from the array x.
Examples:
examples.sql
array_except
Returns an array of elements in x but not in y, without duplicates.
Examples:
examples.sql
array_intersect
Returns an array of the elements in the intersection of x and y, without duplicates.
Examples:
examples.sql
array_join
Concatenates the elements of the given array using the delimiter. Null elements are omitted in the result.
Examples:
examples.sql
array_max
Returns the maximum value of input array.
Supported Signatures
array_min
Returns the minimum value of input array.
Supported Signatures
array_position
Returns the position of the first occurrence of the element in array x (or 0 if not found).
Examples:
examples.sql
array_remove
Remove all elements that equal element from array x.
Examples:
examples.sql
array_sort
Sorts and returns the array x. The elements of x must be orderable. Null elements will be placed at the end of the returned array.
Supported Signatures
array_union
Returns an array of the elements in the union of x and y, without duplicates.
Examples:
examples.sql
arrays_overlap
Tests if arrays x and y have any non-null elements in common. Returns null if there are no non-null elements in common but either array contains null.
Supported Signatures
cardinality
Returns the cardinality (size) of the array x.
Examples:
examples.sql
combinations
Returns n-element sub-groups of input array. If the input array has no duplicates, combinations returns n-element subsets.
Supported Signatures
contains
Takes an array and an element. Returns true if the array contains the element, false if not.
Examples:
examples.sql
contains_sequence
Return true if array x contains all of array seq as a subsequence (all values in the same consecutive order).
Supported Signatures
element_at
Returns element of array at given index. If index > 0, this function provides the same functionality as the SQL-standard subscript operator ([]), except that the function returns NULL when accessing an index larger than array length, whereas the subscript operator would fail in such a case. If index < 0, element_at accesses elements from the last to the first.
Examples:
examples.sql
filter
Constructs an array from those elements of array for which function returns true.
Supported Signatures
flatten
Flattens an array(array(T)) to an array(T) by concatenating the contained arrays.
Examples:
examples.sql
ngrams
Returns n-grams (sub-sequences of adjacent n elements) for the array. The order of the n-grams in the result is unspecified.
Supported Signatures
none_match
Returns whether no elements of an array match the given predicate. Returns true if none of the elements matches the predicate (a special case is when the array is empty); false if one or more elements match; NULL if the predicate function returns NULL for one or more elements and false for all other elements.
Supported Signatures
reduce
Returns a single value reduced from array. inputFunction will be invoked for each element in array in order. In addition to taking the element, inputFunction takes the current state, initially initialState, and returns the new state. outputFunction will be invoked to turn the final state into the result value. It may be the identity function (i -> i).
Supported Signatures
repeat
Repeat element for count times.
Examples:
examples.sql