Statement Meaning Example
Subscript operator [] [] is used to obtain a certain element in the array. -
Connection operator || || is used to connect two arrays into one. SELECT ARRAY [1] || ARRAY [2]; — [1, 2]

SELECT ARRAY [1] || 2; — [1, 2]

SELECT 2 || ARRAY [1]; — [2, 1]

array_distinct Obtain the distinct elements in the array by means of array deduplication. -
array_intersect(x, y) Obtain the intersection of arrays x and y. -
array_union(x, y) → array Obtain the union of arrays x and y. -
array_except(x, y) → array Obtain the subtraction of arrays x and y. -
array_join(x, delimiter, null_replacement) → varchar Join string arrays with the delimiter into a string and replace null values with null_replacement.
Note The maximum size of the returned result of this array_join is 1 KB. If the returned result exceeds 1 KB, the excessive part will be removed.
array_max(x) → x Obtain the maximum value in array x.
array_min(x) → x Obtain the minimum value in array x. -
array_position(x, element) → bigint Obtain the subscript of the element in array x. The subscript starts from 1. 0 is returned if no subscript is found. -
Array_remove (x, element)-array Remove the element from the array. -
array_sort(x) → array Sort the array and move null values to the end. -
cardinality(x) → bigint Obtain the array size. -
concat(array1, array2, …, arrayN) → array Concatenate arrays. -
contains(x, element) → boolean Returns TRUE if array x contains the element. -
This is a Lambda function. See filter() in Lambda. Concatenate a two-dimensional array into a one-dimensional array. -
flatten(x) → array Concatenate a two-dimensional array into a one-dimensional array. -
reduce(array, initialState, inputFunction, outputFunction) → x See function reduce() in Lambda functions. -
reverse(x) → array Sort array x in reverse order. -
sequence(start, stop) → array Generate a sequence from start to stop and increment each step by 1. -
sequence(start, stop, step) → array Generate a sequence from start to stop and increment each step by the specified step value. -
sequence(start, stop, step) → array Generate a timestamp array from start to stop. Start and stop are of the timestamp type. Step is of the interval type, which can be from DAY to SECOND, and can also be YEAR or MONTH. -
shuffle(x) → array Shuffle the array. -
slice(x, start, length) → array Create a new array with length elements from start in array x. -
transform(array, function) → array See transform() in Lambda functions. -
zip(array1, array2[, …]) → array Merge multiple arrays. In the result, the Nth parameter in the Mth element is the Mth element in the Nth original array, which is equivalent to transposing multiple arrays. SELECT zip(ARRAY[1, 2], ARRAY[‘1b’, null, ‘3b’]); — [ROW(1, ‘1b’), ROW(2, null), ROW(null, ‘3b’)]
zip_with(array1, array2, function) → array For more information, see Lambda functions zip_with. -
array_agg (key) array_agg (key) is an aggregation funtion that is used to aggregate all the content of the key column as an array to return. * | select array_agg(key)