All Products
Search
Document Center

MaxCompute:ARRAY function

Last Updated:Jul 23, 2025

MaxCompute supports four complex data types: ARRAY, MAP, STRUCT, and JSON. This topic describes ARRAY functions and their features.

Function

Feature

ALL_MATCH

Determines whether all elements in an ARRAY satisfy the specified condition.

ANY_MATCH

Determines whether there is any element in an ARRAY that satisfies the specified condition.

ARRAY

Constructs an ARRAY with the given values.

ARRAY_CONTAINS

Checks whether the specified ARRAY contains the specified value.

ARRAY_DISTINCT

Removes duplicate elements from an ARRAY.

ARRAY_EXCEPT

Finds elements that are in ARRAY A but not in ARRAY B, removes duplicates, and returns the result as an ARRAY.

ARRAY_INTERSECT

Calculates the intersection of two ARRAYs.

ARRAY_JOIN

Concatenates elements in an ARRAY using the specified string.

ARRAY_MAX

Calculates the maximum value in an ARRAY.

ARRAY_MIN

Calculates the minimum value in an ARRAY.

ARRAY_NORMALIZE

Returns an array with elements normalized according to the specified p-norm.

ARRAY_POSITION

Calculates the position of the first occurrence of the specified element in an ARRAY.

ARRAY_REDUCE

Aggregates elements in an ARRAY.

ARRAY_REMOVE

Removes the specified element from an ARRAY.

ARRAY_REPEAT

Returns an ARRAY with the specified element repeated the specified number of times.

ARRAY_SORT

Sorts elements in an ARRAY.

ARRAY_UNION

Calculates the union of two ARRAYs and removes duplicate elements.

ARRAYS_OVERLAP

Determines whether two ARRAYs contain the same elements.

ARRAYS_ZIP

Merges multiple ARRAYs.

COMBINATIONS

Returns an array composed of N-tuples of input array elements.

CONCAT

Concatenates ARRAYs or strings together.

EXPLODE

A user-defined table-valued function (UDTF) that converts a single row of data into multiple rows.

FILTER

Filters elements in an ARRAY.

FLATTEN

Converts an array of arrays into a single array.

INDEX

Returns the element value at the specified position in an ARRAY.

NGRAMS

Returns an array of N-grams (n-gram) for the specified array elements.

POSEXPLODE

Expands the specified ARRAY with one value per row and two columns per row corresponding to the zero-based index and the array element.

REVERSE

Returns an array with elements in reverse order of the specified array.

SEQUENCE

Generates an array containing specified elements based on an expression.

SHUFFLE

Returns an array with elements randomly arranged from the specified array.

SIZE

Returns the number of elements in the specified ARRAY.

SLICE

Slices an ARRAY and returns an array of specified length starting from the specified position.

SORT_ARRAY

Sorts elements in the specified array.

TRANSFORM

Transforms elements in an ARRAY.

ZIP_WITH

Merges two ARRAYs at the element level by position.