Select persisted features
Once features are in the registry, you can select them in queries — individually, by wildcard, or with local overrides that let you test alternative definitions without modifying the registry.
The examples on this page use data and features from the Create features page, which will be created automatically if needed.
Wildcard selection with SELECT *()
SELECT *() pulls all features matching a criteria — the same filter syntax you'd use in SHOW FEATURES. This is useful when you want to evaluate an entire namespace or a subset of features without listing them one by one:
SELECT *(FEATURES IN FM.TUTORIALS.EXPLORE ORDER BY NAME)| FM.TUTORIALS.EXPLORE.FEATURE1 BIGINT | FM.TUTORIALS.EXPLORE.FEATURE11 BIGINT | FM.TUTORIALS.EXPLORE.FEATURE12 BIGINT | FM.TUTORIALS.EXPLORE.FEATURE2 BIGINT |
|---|---|---|---|
| 11 | 12 | 13 | 2 |
You can mix wildcards with local feature definitions in the same query:
SELECT
FM.TUTORIALS.EXPLORE.FEATURE1,
*(FEATURES IN FM.TUTORIALS.EXPLORE WHERE NAME like '%2')| FM.TUTORIALS.EXPLORE.FEATURE1 BIGINT | FM.TUTORIALS.EXPLORE.FEATURE12 BIGINT | FM.TUTORIALS.EXPLORE.FEATURE2 VARCHAR |
|---|---|---|
| 11 13 2 |
Wildcards also accept dependency-based filters. For example, select all features downstream of a given feature:
SELECT
*(FEATURES WHERE IS_DOWNSTREAM_OF('FM.TUTORIALS.EXPLORE.RFEATURE0') ORDER BY NAME)
FOR CROSS
FM.TUTORIALS.EXPLORE.RFEATURE0 := BIND_VALUE(2),
FM.TUTORIALS.EXPLORE.RFEATURE1 := BIND_VALUE(3);| FM.TUTORIALS.EXPLORE.RFEATURE2 BIGINT | FM.TUTORIALS.EXPLORE.RFEATURE3 BIGINT | FM.TUTORIALS.EXPLORE.RFEATURE4 BIGINT |
|---|---|---|
| 3 | 6 | 8 |
Local overrides
Any persisted feature can be temporarily overridden within a query. The override applies only to that query — the registry definition stays untouched. This is useful for testing alternative implementations, debugging, or running scenario analyses.
Setting up features to override
First, let's create a chain of features where FEATURE3 depends on FEATURE2, which depends on FEATURE1:
CREATE OR REPLACE FEATURES AS
SELECT FM.TUTORIALS.MY_OVERWRITE.FEATURE2 * 2 AS FM.TUTORIALS.MY_OVERWRITE.FEATURE3;| feature_name VARCHAR | status VARCHAR | message VARCHAR |
|---|---|---|
| FM.TUTORIALS.MY_OVERWRITE.FEATURE3 | REPLACED | Feature was replaced |
Overriding with a literal value
Override FEATURE1 with a literal and the change propagates through the dependency chain automatically — FEATURE2 and FEATURE3 recompute using the overridden value:
SELECT
10 AS FM.TUTORIALS.MY_OVERWRITE.FEATURE1,
FM.TUTORIALS.MY_OVERWRITE.FEATURE2,
FM.TUTORIALS.MY_OVERWRITE.FEATURE3
;| FM.TUTORIALS.MY_OVERWRITE.FEATURE1 BIGINT | FM.TUTORIALS.MY_OVERWRITE.FEATURE2 BIGINT | FM.TUTORIALS.MY_OVERWRITE.FEATURE3 BIGINT |
|---|---|---|
| 10 | 12 | 24 |
Overriding with a new definition
You can override multiple features at once. Here, FEATURE1 gets a literal override and FEATURE2 gets an entirely new formula (FEATURE1 * 10 instead of FEATURE1 + 2):
SELECT
10 AS FM.TUTORIALS.MY_OVERWRITE.FEATURE1,
FM.TUTORIALS.MY_OVERWRITE.FEATURE1 * 10 AS FM.TUTORIALS.MY_OVERWRITE.FEATURE2,
FM.TUTORIALS.MY_OVERWRITE.FEATURE3
;| FM.TUTORIALS.MY_OVERWRITE.FEATURE1 BIGINT | FM.TUTORIALS.MY_OVERWRITE.FEATURE2 BIGINT | FM.TUTORIALS.MY_OVERWRITE.FEATURE3 BIGINT |
|---|---|---|
| 10 | 100 | 200 |
Overriding with bound values
Overrides work with INPUT() and BIND_VALUES() too, letting you sweep through multiple input values while the dependency chain recomputes for each one:
SELECT
FM.TUTORIALS.MY_OVERWRITE.FEATURE1 := INPUT(BIGINT),
FM.TUTORIALS.MY_OVERWRITE.FEATURE2,
FM.TUTORIALS.MY_OVERWRITE.FEATURE3
FOR
FM.TUTORIALS.MY_OVERWRITE.FEATURE1 := BIND_VALUES(ARRAY[10,11,12])| FM.TUTORIALS.MY_OVERWRITE.FEATURE1 BIGINT | FM.TUTORIALS.MY_OVERWRITE.FEATURE2 BIGINT | FM.TUTORIALS.MY_OVERWRITE.FEATURE3 BIGINT |
|---|---|---|
| 10 | 12 | 24 |
| 11 | 13 | 26 |
| 12 | 14 | 28 |
Overrides are always local — the registry is never modified. Changes propagate automatically through the dependency graph, so overriding one feature causes all its dependents to recompute. The only constraint is type consistency: an override must remain compatible with the types expected by downstream features.