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:

FeatureQL
CREATE OR REPLACE FEATURES AS
PERSIST
    fm.tutorials.explore.feature1 := 1,
    fm.tutorials.explore.feature2 := 2
;
Result
feature_name VARCHARstatus VARCHARmessage VARCHAR
FM.TUTORIALS.EXPLORE.FEATURE1CREATEDFeature created as not exists
FM.TUTORIALS.EXPLORE.FEATURE2CREATEDFeature created as not exists

Request only the NAME column when you need a compact inventory:

FeatureQL
SHOW FEATURES (COLUMNS (NAME)) IN FM.TUTORIALS.EXPLORE;
Result
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:

FeatureQL
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')
;
Result
feature_name VARCHARstatus VARCHARmessage VARCHAR
FM.TUTORIALS.EXPLORE.FEATURE1REPLACEDFeature was replaced
FM.TUTORIALS.EXPLORE.FEATURE11CREATEDFeature created as not exists
FM.TUTORIALS.EXPLORE.FEATURE12CREATEDFeature created as not exists

Filter the result

Start with the shortcut that matches your task:

ShorthandWhat it does
SHOW FEATURE NAME_OF_FEATUREExact name match
SHOW FEATURES NAME1, NAME2Filter to specific names
SHOW FEATURES LIKE 'FM.CUSTOMERS.%'Pattern match
SHOW FEATURES IN FM.CUSTOMERSFeatures directly in a namespace (one level)
SHOW FEATURES IN FM.CUSTOMERS UP TO LEVEL 2Features in a namespace up to a given depth
SHOW RECENT FEATURESMost 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:

FeatureQL
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;
Result
NAME VARCHARDATATYPE VARCHARFORMULA VARCHARSTATUS VARCHAR
FM.TUTORIALS.EXPLORE.FEATURE1BIGINT11DEV
FM.TUTORIALS.EXPLORE.FEATURE11BIGINTFM.TUTORIALS.EXPLORE.FEATURE1 + 1DEV

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:

OperatorDescription
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.

FeatureQL
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
;
Result
feature_name VARCHARstatus VARCHARmessage VARCHAR
FM.TUTORIALS.EXPLORE.RFEATURE0CREATEDFeature created as not exists
FM.TUTORIALS.EXPLORE.RFEATURE1CREATEDFeature created as not exists
FM.TUTORIALS.EXPLORE.RFEATURE2CREATEDFeature created as not exists
FM.TUTORIALS.EXPLORE.RFEATURE3CREATEDFeature created as not exists
FM.TUTORIALS.EXPLORE.RFEATURE4CREATEDFeature 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?”:

FeatureQL
SHOW FEATURES (COLUMNS (NAME, FORMULA)) WHERE IS_UPSTREAM_OF('FM.TUTORIALS.EXPLORE.RFEATURE3')
Result
NAME VARCHARFORMULA VARCHAR
FM.TUTORIALS.EXPLORE.RFEATURE0INPUT(BIGINT)
FM.TUTORIALS.EXPLORE.RFEATURE1INPUT(BIGINT)
FM.TUTORIALS.EXPLORE.RFEATURE2FM.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:

FeatureQL
SHOW FEATURES (COLUMNS (NAME, FORMULA)) WHERE IS_DOWNSTREAM_OF('FM.TUTORIALS.EXPLORE.RFEATURE3')
Result
NAME VARCHARFORMULA VARCHAR
FM.TUTORIALS.EXPLORE.RFEATURE4FM.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:

FeatureQL
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
Result
NAME VARCHARFORMULA VARCHARDEPTH_IN_DAG BIGINT
FM.TUTORIALS.EXPLORE.RFEATURE0INPUT(BIGINT)-2
FM.TUTORIALS.EXPLORE.RFEATURE1INPUT(BIGINT)-2
FM.TUTORIALS.EXPLORE.RFEATURE2FM.TUTORIALS.EXPLORE.RFEATURE0 + 1-1
FM.TUTORIALS.EXPLORE.RFEATURE3FM.TUTORIALS.EXPLORE.RFEATURE1 + FM.TUTORIALS.EXPLORE.RFEATURE20
FM.TUTORIALS.EXPLORE.RFEATURE4FM.TUTORIALS.EXPLORE.RFEATURE3 + 21

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:

FeatureQL
RETURN TRACE
    f4 := f2 + f3,
    f1 := 1,
    f2 := f1 + 1,
    f3 := f1 * 2
;
Result
F1 BIGINTF2 BIGINTF3 BIGINTF4 BIGINT
1224

With persisted features, naming only RFEATURE4 expands all five features in its upstream tree:

FeatureQL
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)
;
Result
FM.TUTORIALS.EXPLORE.RFEATURE0 BIGINTFM.TUTORIALS.EXPLORE.RFEATURE1 BIGINTFM.TUTORIALS.EXPLORE.RFEATURE2 BIGINTFM.TUTORIALS.EXPLORE.RFEATURE3 BIGINTFM.TUTORIALS.EXPLORE.RFEATURE4 BIGINT
23368

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 name
  • DATATYPE: FeatureQL type
  • FUNCTION: top-level function used by the definition
  • FORMULA: stored feature expression
  • DEPENDENCIES: upstream feature names and depths
  • CREATED_AT and UPDATED_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 .