This page describes the ZIP function in Lenses SQL.
ZIP(array1, field1, array2, field2, …)
Zip two or more arrays into a single one. Example: ZIP([1, 2], 'x', [3, 4, 5], 'y') will be evaluated to [{ x: 1, y: 3 }, { x: 2, y: 4 }]
ZIP([1, 2], 'x', [3, 4, 5], 'y')
[{ x: 1, y: 3 }, { x: 2, y: 4 }]
Available in:
✓
Sample code:
USE `kafka`; SELECT ZIP([1, 2], 'x', [3, 4, 5], 'y') FROM numbers-data LIMIT 1;
Output:
{ "value": { "ZIP": [ { "x": 1, "y": 3 }, { "x": 2, "y": 4 } ] } }