BIND_VALUES()
All functions > CORE > BIND_VALUES()
Binds the given array of values to the given feature or features.
Signatures
Returns: A table with the array values unnested into rows and columns
BIND_VALUES(array: ARRAY<ROW<T>>, [ordinality: BOOLEAN]) → TABLE<T> sql
| Parameter | Type | Required | Description |
|---|---|---|---|
array | ARRAY<ROW<T>> | Yes | An array of row values to bind as a table |
ordinality | BOOLEAN | No | Include row number column |
Notes
- Converts an array into a table structure for feature binding
- Unnests array elements into individual rows
- Can handle both simple arrays and arrays of row structures
- Optional ordinality parameter adds row numbering
- Supports mapping array elements to named features
- Used in feature materialization from array data
- Part of the FeatureMesh binding system
Examples
Array of scalars: one input, multiple rows
FeatureQL
WITH
INPUT1 := INPUT(BIGINT),
CALCULATED := INPUT1 + 1
SELECT
INPUT1,
CALCULATED,
FOR
INPUT1 := BIND_VALUES(ARRAY[1, 3, 5]),
;Result
| INPUT1 BIGINT | CALCULATED VARCHAR |
|---|---|
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |
Array of rows: multiple inputs in lockstep
FeatureQL
WITH
INPUT1 := INPUT(BIGINT),
INPUT2 := INPUT(BIGINT),
CALCULATED := INPUT1 + INPUT2
SELECT
INPUT1,
INPUT2,
CALCULATED
FOR
(INPUT1, INPUT2) := BIND_VALUES(ARRAY[ROW(1, 2), ROW(3, 4), ROW(5, 6)]),
;Result
| INPUT1 BIGINT | INPUT2 BIGINT | CALCULATED VARCHAR |
|---|---|---|
| 1 | 2 | 3 |
| 3 | 4 | 7 |
| 5 | 6 | 11 |