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
ParameterTypeRequiredDescription
arrayARRAY<ROW<T>>YesAn array of row values to bind as a table
ordinalityBOOLEANNoInclude 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 BIGINTCALCULATED VARCHAR
12
34
56

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 BIGINTINPUT2 BIGINTCALCULATED VARCHAR
123
347
5611

Last update at: 2026/05/26 17:22:09