Feature metadata

Feature metadata helps people discover and present features without changing what they compute. Descriptions, free attributes, display patterns, ROW field notes, and namespace position live on the catalog. What a numeric feature measures and how an already summarized metric may roll up are compiler semantics, not free metadata; see Units and measures and Metric additivity . Lifecycle status is separate because it governs dependency compatibility.

Description

Set purpose text at create time with WITH (DESCRIPTION = …), or update with ALTER FEATURE (one name) / ALTER FEATURES (an explicit name list). Mutation never accepts WHERE / LIKE. The legacy COMMENT '…' suffix is rejected — use WITH (DESCRIPTION = …).

FeatureQL
ALTER FEATURE FM.TUTORIALS.DISCOVERABILITY.FEATURE2
SET DESCRIPTION = 'Adds one unit to FEATURE1';
Result
feature_name VARCHARstatus VARCHARmessage VARCHAR
FM.TUTORIALS.DISCOVERABILITY.FEATURE2ALTEREDFeature successfully altered

FeatureQL
SHOW FEATURES (COLUMNS (NAME, DESCRIPTION))
WHERE NAME = 'FM.TUTORIALS.DISCOVERABILITY.FEATURE2';
Result
NAME VARCHARDESCRIPTION VARCHAR
FM.TUTORIALS.DISCOVERABILITY.FEATURE2Adds one unit to FEATURE1

Custom attributes

Free string attributes are project-defined key/value pairs. Keys are ASCII identifiers (case-insensitive, stored lowercase). They do not grant permissions, change lifecycle, or affect generated SQL.

CREATE OR REPLACE is full desired state: omitted description, attributes, and display format are cleared.

FeatureQL
CREATE OR REPLACE FEATURES AS
PERSIST
    fm.tutorials.discoverability.feature2 := fm.tutorials.discoverability.feature1
    + 1 WITH (DESCRIPTION = 'Adds one unit to FEATURE1', DISPLAY_FORMAT = '#,##0', team = 'finance')
;
Result
feature_name VARCHARstatus VARCHARmessage VARCHAR
FM.TUTORIALS.DISCOVERABILITY.FEATURE2REPLACEDFeature was replaced

FeatureQL
SHOW FEATURES (COLUMNS (NAME, DESCRIPTION, ATTRIBUTES))
WHERE NAME = 'FM.TUTORIALS.DISCOVERABILITY.FEATURE2';
Result
NAME VARCHARDESCRIPTION VARCHARATTRIBUTES JSON
FM.TUTORIALS.DISCOVERABILITY.FEATURE2Adds one unit to FEATURE1{"team": "finance"}

Display format

DISPLAY_FORMAT stores a numeric presentation pattern (for example #,##0 or 0.00%) for clients. The registry validates and persists it (PRESENTATION in SHOW). It does not change datatype or SQL, and FeatureMesh does not render values yet. Quote the property when needed: "DISPLAY_FORMAT" = '#,##0'.

FeatureQL
SHOW FEATURES (COLUMNS (NAME, PRESENTATION))
WHERE NAME = 'FM.TUTORIALS.DISCOVERABILITY.FEATURE2';
Result
NAME VARCHARPRESENTATION JSON
FM.TUTORIALS.DISCOVERABILITY.FEATURE2{"pattern": "#,##0"}

ROW field metadata

On typed ROW inputs, attach the same properties per field with WITH (…) after the field type. Read them back with FIELD_METADATA; change them with ALTER FEATURE … FIELD name SET ….

FeatureQL
CREATE OR REPLACE FEATURES AS
PERSIST
    fm.tutorials.discoverability.order_summary := INPUT(ROW<
        amount BIGINT WITH (DESCRIPTION = 'Line amount', team = 'finance'),
        note VARCHAR WITH (DESCRIPTION = 'Optional note')
    >)
;
Result
feature_name VARCHARstatus VARCHARmessage VARCHAR
FM.TUTORIALS.DISCOVERABILITY.ORDER_SUMMARYCREATEDFeature created as not exists

FeatureQL
SHOW FEATURES (COLUMNS (NAME, FIELD_METADATA))
WHERE NAME = 'FM.TUTORIALS.DISCOVERABILITY.ORDER_SUMMARY';
Result
NAME VARCHARFIELD_METADATA JSON
FM.TUTORIALS.DISCOVERABILITY.ORDER_SUMMARY{"note": {"description": "Optional note"}, "amount": {"attributes": {"team": "finance"}, "description": "Line amount"}}

Position in namespace

Reorder features for explorers and docs with ALTER FEATURE … SET POSITION … (FIRST, LAST, BEFORE / AFTER another feature, HIDE, or an absolute number).

FeatureQL
ALTER FEATURE FM.TUTORIALS.DISCOVERABILITY.FEATURE1
SET POSITION AFTER FM.TUTORIALS.DISCOVERABILITY.FEATURE2;
Result
feature_name VARCHARstatus VARCHARmessage VARCHAR
FM.TUTORIALS.DISCOVERABILITY.FEATURE1NEW_POSITION25.0

FeatureQL
SHOW FEATURES (COLUMNS (NAME, DATATYPE, FORMULA, POSITION)) WHERE NAME LIKE 'FM.TUTORIALS.DISCOVERABILITY.FEATURE%';
Result
NAME VARCHARDATATYPE VARCHARFORMULA VARCHARPOSITION BIGINT
FM.TUTORIALS.DISCOVERABILITY.FEATURE1BIGINT125
FM.TUTORIALS.DISCOVERABILITY.FEATURE2BIGINTFM.TUTORIALS.DISCOVERABILITY.FEATURE1 + 150

Next