All Products
Search
Document Center

MaxCompute:CONCAT

Last Updated:Mar 25, 2026

Concatenates multiple arrays into a new array, or concatenates multiple strings into a new string.

Null behavior differs by overload:

  • Array overload: If any input array is null, returns null. Null elements within an array are included in the result.

  • String overload: If any input parameter is null or no parameters are provided, returns null.

Syntax

array<T> concat(array<T> <a>, array<T> <b>[,...])  → array<T>
string concat(string <str1>, string <str2>[,...])   → string

Parameters

Array overload

ParameterRequiredDescription
a, bYesArrays to concatenate. T can be any data type, but all input arrays must contain elements of the same data type. Null elements are included in the operation.

String overload

ParameterRequiredDescription
str1, str2YesStrings to concatenate. BIGINT, DOUBLE, DECIMAL, and DATETIME values are implicitly converted to STRING before concatenation. All other data types return an error.

Examples

Array concatenation

-- Returns [10, 20, 20, -20]
SELECT concat(array(10, 20), array(20, -20));

-- Null elements are preserved: returns [10, null, 20, -20]
SELECT concat(array(10, null), array(20, -20));

-- A null array returns null
SELECT concat(array(10, 20), null);

String concatenation

-- Returns aabcabcde
SELECT concat('aabc', 'abcde');

-- No arguments; returns null
SELECT concat();

-- A null argument returns null
SELECT concat('aabc', 'abcde', null);

Related functions

CONCAT is both a complex type function and a string function.