ARRAY_MERGE_FUNC

All functions > ROW > ARRAY_MERGE_FUNC

Merges multiple arrays of rows element-wise into a single array of combined rows

Syntax

ARRAY_MERGE_FUNC(expressions)
sql

Arguments

ParameterTypeRequiredDescription
expressionsARRAYROWYesArray of array-of-row expressions to merge

Returns

ARRAY[ROW] - Array of rows where each row contains merged fields from corresponding positions

Notes

  • Requires at least 2 arrays of rows to merge
  • Merges rows element-wise by position (first with first, second with second, etc.)
  • If arrays have different lengths, shorter arrays are padded with NULL values
  • All field names must be unique across all rows
  • Result array length equals the longest input array

Examples

Last update at: 2025/10/13 10:23:46