v.20.1New Feature

Add arrayZip function for combining multiple arrays into tuples

Add arrayZip function which allows to combine multiple arrays of equal lengths into one array of tuples. #8149 (Winter Zhang)
Introduces the arrayZip function that combines multiple arrays of equal length into a single array of tuples.

Why it matters

The arrayZip function addresses the need to merge arrays element-wise, enabling users to work with grouped elements from multiple arrays as tuples. This simplifies data transformation and processing tasks where parallel array elements need to be combined.

How to use it

Use the arrayZip function by passing multiple arrays of the same length as arguments. It returns an array where each element is a tuple consisting of elements from the input arrays at the corresponding position. For example:

SELECT arrayZip([1, 2, 3], ['a', 'b', 'c'])

This returns: [(1, 'a'), (2, 'b'), (3, 'c')].