Explore features
SHOW FEATURES lets you find persisted features, inspect their formulas, and understand the dependency graph before you reuse or change anything.
Inspect a namespace
The examples use a small isolated namespace. First, create two features:
CREATE OR REPLACE FEATURES AS
PERSIST
fm.tutorials.explore.feature1 := 1,
fm.tutorials.explore.feature2 := 2
;| feature_name VARCHAR | status VARCHAR | message VARCHAR |
|---|---|---|
| FM.TUTORIALS.EXPLORE.FEATURE1 | CREATED | Feature created as not exists |
| FM.TUTORIALS.EXPLORE.FEATURE2 | CREATED | Feature created as not exists |
Request only the NAME column when you need a compact inventory:
SHOW FEATURES (COLUMNS (NAME)) IN FM.TUTORIALS.EXPLORE;| NAME VARCHAR |
|---|
| FM.TUTORIALS.EXPLORE.FEATURE1 |
| FM.TUTORIALS.EXPLORE.FEATURE2 |
SHOW FEATURES always reads the current registry state. After a replacement and two additions, the same namespace immediately reflects those changes:
CREATE OR REPLACE FEATURES AS
PERSIST
fm.tutorials.explore.feature1 := 11,
fm.tutorials.explore.feature11 := fm.tutorials.explore.feature1 + 1,
fm.tutorials.explore.feature12 := fm.tutorials.explore.feature1
+ fm.tutorials.explore.feature2 WITH (DESCRIPTION = 'Adds FEATURE1 and FEATURE2')
;| feature_name VARCHAR | status VARCHAR | message VARCHAR |
|---|---|---|
| FM.TUTORIALS.EXPLORE.FEATURE1 | REPLACED | Feature was replaced |
| FM.TUTORIALS.EXPLORE.FEATURE11 | CREATED | Feature created as not exists |
| FM.TUTORIALS.EXPLORE.FEATURE12 | CREATED | Feature created as not exists |
Filter the result
Start with the shortcut that matches your task:
| Shorthand | What it does |
|---|---|
SHOW FEATURE NAME_OF_FEATURE | Exact name match |
SHOW FEATURES NAME1, NAME2 | Filter to specific names |
SHOW FEATURES LIKE 'FM.CUSTOMERS.%' | Pattern match |
SHOW FEATURES IN FM.CUSTOMERS | Features directly in a namespace (one level) |
SHOW FEATURES IN FM.CUSTOMERS UP TO LEVEL 2 | Features in a namespace up to a given depth |
SHOW RECENT FEATURES | Most recently created features (last 50) |
The shortcuts can be combined. This query applies a name pattern inside a namespace, controls the search depth, orders the result, and limits its size:
SHOW FEATURES (COLUMNS (NAME, DATATYPE, FORMULA, STATUS)) LIKE '%EXPLORE%1' IN FM.TUTORIALS UP TO LEVEL 2 WHERE NAME NOT LIKE '%EXPLORE1%' ORDER BY NAME LIMIT 10;| NAME VARCHAR | DATATYPE VARCHAR | FORMULA VARCHAR | STATUS VARCHAR |
|---|---|---|---|
| FM.TUTORIALS.EXPLORE.FEATURE1 | BIGINT | 11 | DEV |
| FM.TUTORIALS.EXPLORE.FEATURE11 | BIGINT | FM.TUTORIALS.EXPLORE.FEATURE1 + 1 | DEV |
Use COLUMNS when you want an exact output shape. Use INCLUDE to add derived fields to the default output, or EXCLUDE to remove fields. Because SHOW FEATURES returns tabular data, you can also use WHERE, ORDER BY, and LIMIT.
Analyze dependencies
FeatureQL stores dependencies as a directed graph. Three operators answer the common impact-analysis questions:
| Operator | Description |
|---|---|
IS_UPSTREAM_OF(feature) | True if the feature is a dependency of the specified feature |
IS_DOWNSTREAM_OF(feature) | True if the feature depends on the specified feature |
DEPTH_RELATIVE_TO(feature) | Signed distance in the dependency graph |
Create a small chain: RFEATURE0 and RFEATURE1 are inputs, and RFEATURE4 is the final derived feature.
CREATE OR REPLACE FEATURES IN FM.TUTORIALS.EXPLORE AS
PERSIST
rfeature0 := INPUT(BIGINT),
rfeature1 := INPUT(BIGINT),
rfeature2 := rfeature0 + 1,
rfeature3 := rfeature1 + rfeature2,
rfeature4 := rfeature3 + 2
;| feature_name VARCHAR | status VARCHAR | message VARCHAR |
|---|---|---|
| FM.TUTORIALS.EXPLORE.RFEATURE0 | CREATED | Feature created as not exists |
| FM.TUTORIALS.EXPLORE.RFEATURE1 | CREATED | Feature created as not exists |
| FM.TUTORIALS.EXPLORE.RFEATURE2 | CREATED | Feature created as not exists |
| FM.TUTORIALS.EXPLORE.RFEATURE3 | CREATED | Feature created as not exists |
| FM.TUTORIALS.EXPLORE.RFEATURE4 | CREATED | Feature created as not exists |
Find what a feature needs
IS_UPSTREAM_OF() returns the features needed to compute its argument. This query answers “What does RFEATURE3 depend on?”:
SHOW FEATURES (COLUMNS (NAME, FORMULA)) WHERE IS_UPSTREAM_OF('FM.TUTORIALS.EXPLORE.RFEATURE3')| NAME VARCHAR | FORMULA VARCHAR |
|---|---|
| FM.TUTORIALS.EXPLORE.RFEATURE0 | INPUT(BIGINT) |
| FM.TUTORIALS.EXPLORE.RFEATURE1 | INPUT(BIGINT) |
| FM.TUTORIALS.EXPLORE.RFEATURE2 | FM.TUTORIALS.EXPLORE.RFEATURE0 + 1 |
Find what a change could affect
IS_DOWNSTREAM_OF() returns features that depend on its argument. Use it before replacing or dropping a feature:
SHOW FEATURES (COLUMNS (NAME, FORMULA)) WHERE IS_DOWNSTREAM_OF('FM.TUTORIALS.EXPLORE.RFEATURE3')| NAME VARCHAR | FORMULA VARCHAR |
|---|---|
| FM.TUTORIALS.EXPLORE.RFEATURE4 | FM.TUTORIALS.EXPLORE.RFEATURE3 + 2 |
Measure graph distance
DEPTH_RELATIVE_TO() returns 0 for the reference feature, negative values for upstream dependencies, and positive values for downstream dependents:
SHOW FEATURES (
COLUMNS (NAME, FORMULA),
INCLUDE (DEPTH_RELATIVE_TO('FM.TUTORIALS.EXPLORE.RFEATURE3') as DEPTH_IN_DAG)
)
WHERE DEPTH_IN_DAG IS NOT NULL
ORDER BY DEPTH_IN_DAG ASC, NAME| NAME VARCHAR | FORMULA VARCHAR | DEPTH_IN_DAG BIGINT |
|---|---|---|
| FM.TUTORIALS.EXPLORE.RFEATURE0 | INPUT(BIGINT) | -2 |
| FM.TUTORIALS.EXPLORE.RFEATURE1 | INPUT(BIGINT) | -2 |
| FM.TUTORIALS.EXPLORE.RFEATURE2 | FM.TUTORIALS.EXPLORE.RFEATURE0 + 1 | -1 |
| FM.TUTORIALS.EXPLORE.RFEATURE3 | FM.TUTORIALS.EXPLORE.RFEATURE1 + FM.TUTORIALS.EXPLORE.RFEATURE2 | 0 |
| FM.TUTORIALS.EXPLORE.RFEATURE4 | FM.TUTORIALS.EXPLORE.RFEATURE3 + 2 | 1 |
Evaluate a complete trace
RETURN TRACE evaluates the named upstream dependency chain as well as the requested output. It returns inputs first and the requested feature last, regardless of definition order.
With local features, the ordering is easy to see:
RETURN TRACE
f4 := f2 + f3,
f1 := 1,
f2 := f1 + 1,
f3 := f1 * 2
;| F1 BIGINT | F2 BIGINT | F3 BIGINT | F4 BIGINT |
|---|---|---|---|
| 1 | 2 | 2 | 4 |
With persisted features, naming only RFEATURE4 expands all five features in its upstream tree:
RETURN TRACE
fm.tutorials.explore.rfeature4
FROM FM.TUTORIALS.EXPLORE
FOR
fm.tutorials.explore.rfeature0 := BIND_VALUE(2),
fm.tutorials.explore.rfeature1 := BIND_VALUE(3)
;| FM.TUTORIALS.EXPLORE.RFEATURE0 BIGINT | FM.TUTORIALS.EXPLORE.RFEATURE1 BIGINT | FM.TUTORIALS.EXPLORE.RFEATURE2 BIGINT | FM.TUTORIALS.EXPLORE.RFEATURE3 BIGINT | FM.TUTORIALS.EXPLORE.RFEATURE4 BIGINT |
|---|---|---|---|---|
| 2 | 3 | 3 | 6 | 8 |
Use ordinary RETURN when you need only final outputs. Use RETURN TRACE when intermediate values help you understand or debug the computation. RETURN TRACE is an in-query tool — Tools in the query .
Full SHOW FEATURES shape
SHOW [ALL] [RECENT] FEATURES
[(INCLUDE <fields> | EXCLUDE <fields> | COLUMNS <fields>)]
[<feature_name>, ...]
[IN <namespace> [UP TO LEVEL <n>]]
[LIKE <pattern>]
[WHERE <condition>]
[ORDER BY <expression>]
[LIMIT <n>];
Common metadata fields include:
NAME: fully qualified feature nameDATATYPE: FeatureQL typeFUNCTION: top-level function used by the definitionFORMULA: stored feature expressionDEPENDENCIES: upstream feature names and depthsCREATED_ATandUPDATED_AT: registry timestamps
Next
Continue with Select persisted features to evaluate the features you found, or read Registry consistency before changing a widely used definition. To inspect past definitions, see Catalog revisions . To try a change without writing HEAD, see Branch overlays . For the complete catalog selector grammar, see the SHOW syntax reference .