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
  • Internal scalar flag marks BIND_VALUES rewritten from BIND_VALUE (single scalar, not a multi-row bind)
  • 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/06/20 10:08:10