---
title: arrays_zip function
description: Learn the syntax of the arrays\_zip function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/arrays_zip
---

# `arrays_zip` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Returns a merged array of structs in which the nth struct contains all nth values of input arrays.

## Syntax

```
arrays_zip (array1 [, ...])
```

## Arguments

* `arrayN`: An ARRAY.

## Returns

An ARRAY of STRUCT where the type of the nth field that matches the type of the elements of `arrayN`.

The number of array arguments can be 0 or more.
If the function is called without arguments it returns an empty array of an empty struct.
Arrays that are shorter than the largest array are extended with null elements.

## Examples

```sql
> SELECT arrays_zip(array(1, 2, 3), array(2, 3, 4));
 [{1,2},{2,3},{3,4}]

> SELECT arrays_zip(array(1, 2), array(2, 3), array(3, 4));
 [{1,2,3},{2,3,4}]

> SELECT arrays_zip(array(1, 2), array('shoe', 'string', 'budget'));
 [{1, shoe},{2, string},{null,budget}]

> SELECT arrays_zip();
 [{}]
```

## Related functions

* [`array_union` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array_union.md)
