Binding inputs
Input features must be bound to concrete values before query execution.
In case of a single feature to bind:
- Binding 1 value to the feature. The result set will have 1 row.
- Binding n values to the feature. The result set will have n rows.
In case of multiple features to bind:
- Single binding: Binding a set of n values to all features together. The result set will have n row.
- Separate bindings: Binding a set of n, m, ... values to each feature separately. The result set will have n * m * ... rows.
You are not limited in binding input values and can bind any intermediate feature.
Regarding the source of data you want to bind, FeatureQL provides several binding mechanisms for different use cases.
| Operator | Purpose / Use Case |
|---|---|
BIND_VALUE() | Transform single value into input set. Single value testing and simple parameterization. |
BIND_VALUES() | Transform inline arrays into input sets. Inlined arrays for input sets, testing scenarios, small-scale batch processing. |
BIND_COLUMNS() | Transform columns from a table into input sets. Batch feature execution over tabular data. |
BIND_SQL() | Execute SQL queries to generate input data (query must match backend SQL dialect). Dynamic input generation; integration with existing data queries. |
BIND_KEYSET() | Select entity keys based on business criteria (business extension). Entity-based analytics; for feature evaluation with key selection—especially for offline analytics. |
Bind single input set
This example shows basic input binding:
BIND_VALUE('FeatureQL')provides a concrete value for theNAMEinputBIND_VALUE(5)provides a value for theNUMBERinput- Derived features (
HELLO,OTHER_NUMBER) are automatically computed using the bound values
Bind multiple input sets
For batch processing or analytical workloads, you often need to evaluate features for multiple inputs simultaneously.
Single feature binding
This demonstrates:
BIND_VALUES(ARRAY[1, 3, 5])creates three rows with differentFEATUREF1values- Each row produces a corresponding
FEATUREFFvalue (FEATUREF1 + 1) - Result: 3 rows with computations for values 1, 3, and 5
Multiple features with single binding
Key insights:
BIND_VALUES(ARRAY[ROW(1, 2), ROW(3, 4), ROW(5, 6)])binds both features simultaneously- Each ROW provides values for
(FEATUREF1, FEATUREF2)in a single operation - Creates exactly 3 rows with coordinated input pairs
Multiple features with separate bindings
Important difference:
- Separate
BIND_VALUES()calls create a Cartesian product - 3 values Ă— 3 values = 9 total combinations
- Use this pattern when you want all possible input combinations
Bind intermediary features
You can also bind any intermediate feature, not just direct inputs.
Let's consider a FEATURE4 that is computed as FEATURE3 * 2, and FEATURE3 is computed as FEATURE1 + FEATURE2.
You can naturally bind FEATURE1 and FEATURE2 to values and FEATURE4 will be computed as (FEATURE1 + FEATURE2) * 2.
You can also bind intermediary feature FEATURE3 to a value, and FEATURE4 will be computed as FEATURE3 * 2. FEATURE1 and FEATURE2 will then be not used.
Bind to external data
Let's create a table with some columns.
Then we can bind these data to features.
Using column names
Using a SQL query
Using sets of keys
For analytics, you can use predefined sets of keys with BIND_KEYSET().
See more details in the bind keyset section.