ZIP_ALL
This page describes the ZIP_ALL function in Lenses SQL.
ZIP_ALL(array1, field1, array2, field2, …)
Zip two or more arrays into a single one, returning null
s when an array is not long enough.
Example: ZIP_ALL([1, 2], 'x', [3, 4, 5], 'y')
will be evaluated to [{ x: 1, y: 3 }, { x: 2, y: 4 }, { x: null, y: 5 }]
Available in:
Processors
SQL Studio
✓
✓
Sample code:
USE `kafka`;
SELECT
ZIP_ALL([1, 2], 'x', [3, 4, 5], 'y')
FROM numbers-data
LIMIT 1;
Output:
{
"value": {
"ZIP_ALL": [
{
"x": 1,
"y": 3
},
{
"x": 2,
"y": 4
},
{
"x": null,
"y": 5
}
]
}
}
Last updated
Was this helpful?