BIND_COLUMNS()
All functions > CORE > BIND_COLUMNS()
Binds columns from a table to the given features.
Signatures
Returns: A table with the selected columns bound to features
BIND_COLUMNS(columns: ARRAY<VARCHAR>, source_type: VARCHAR, source_content: VARCHAR) → TABLE<T> sql
| Parameter | Type | Required | Description |
|---|---|---|---|
columns | ARRAY<VARCHAR> | Yes | Array of column names to select from the source |
source_type | VARCHAR | Yes | Type of source: TABLE, SQL, CSV, TSV, or JSON |
source_content | VARCHAR | Yes | The source content (table name, SQL query, CSV text, TSV text, or JSON text) |
Notes
- Binds specific columns from a source to features
- Supports multiple source types: TABLE(name), SQL(query), CSV(data), TSV(data), JSON(data)
- Column names are mapped to feature names in order
- Provides a simpler alternative to BIND_SQL for basic selections
- The number of columns must match the number of features
- Part of the FeatureMesh binding system
Examples
Bind INPUTs from physical table columns (with setup in same .slt file)
FeatureQL
WITH
INPUT1 := INPUT(BIGINT),
INPUT2 := INPUT(BIGINT),
ADD_INPUTS := INPUT1 + INPUT2,
SELECT
INPUT1,
INPUT2,
ADD_INPUTS,
FOR
(INPUT1, INPUT2) := BIND_COLUMNS(val1, val2 FROM TABLE(bnd.table_example)),Result
| INPUT1 BIGINT | INPUT2 BIGINT | ADD_INPUTS BIGINT |
|---|---|---|
| 2 | 2 | 4 |
| 3 | 4 | 7 |
| 4 | 6 | 10 |