Skip to content
Legacy docs for Tenzir v5.x. For the latest Tenzir v6 series, visit docs.tenzir.com. Migrating from v5? Read the Tenzir v6 migration guide.

Combines two lists into a list of pairs.

zip(xs:list, ys:list) -> list

The zip function returns a list containing records with two fields left and right, each containing the respective elements of the input lists.

If both lists are null, zip returns null. If one of the lists is null or has a mismatching length, missing values are filled in with nulls, using the longer list’s length, and a warning is emitted.

from {xs: [1, 2], ys: [3, 4]}
select zs = zip(xs, ys)
{
zs: [
{left: 1, right: 3},
{left: 2, right: 4}
]
}

Last updated: