Column comment propagation¶
Comment propagation uses the BY_NAME column lineage that Snowflake records for your objects. When you set or
unset a comment on a column, Snowflake finds the downstream columns that read it as-is and applies the same comment to
them. When you create an object, its columns inherit the comments that already exist upstream. Snowflake records how
each comment was applied, so you can distinguish a comment that a user wrote from one that propagation applied.
Enable and disable comment propagation¶
Comment propagation is controlled by the account-level FEATURE_COMMENT_PROPAGATION parameter. The parameter is
DISABLED by default, so nothing propagates until an account administrator turns the feature on. After Snowflake enables
this preview for your account, use ALTER ACCOUNT to set the parameter:
To check the current value:
To turn the feature off for your account:
Disabling the feature stops all future propagation. Comments that already propagated stay where they are, and they keep their recorded apply method. To return the parameter to its default value, unset it:
Supported objects¶
Comment propagation supports every column that BY_NAME column lineage covers. The set of supported objects comes from
that lineage rather than from comment propagation:
| Object | Can be a source of a propagated comment | Can receive a propagated comment |
|---|---|---|
| Table | Yes | No |
| View, including a secure view | Yes | Yes |
| Materialized view | Yes | Yes |
| Dynamic table | Yes | Yes |
As-is lineage¶
Propagation follows as-is BY_NAME column lineage. For more information about BY_NAME dependencies, see
Object Dependencies.
A downstream column is as-is when it reproduces exactly one upstream column without changing its values. A comment is only meaningful downstream when the values it describes are still the same values, which is why propagation stops at the first column that transforms, combines, or aggregates its input.
The examples in this section read from a base table t1 whose columns include c1 and c2, a c_num column typed
NUMBER(10,0), and a c_str column typed VARCHAR(20).
Relationships that are as-is¶
- A bare projection of a single column
The column is selected directly, with or without an alias, and with or without a
WHEREclause or a join:Selecting with
SELECT *is a bare projection of every column, so every column of the resulting object is as-is.- A lossless cast of a single column
The cast stays in the same type family and can’t lose any value, for example widening
NUMBER(10,0)toNUMBER(38,0), wideningVARCHAR(20)toVARCHAR(50), or changing only nullability:- A passthrough through a subquery or a common table expression
Snowflake follows the projection into derived tables and CTEs and classifies the relationship by what the innermost expression does:
Relationships that aren’t as-is¶
- Any expression that alters the value
Scalar functions, arithmetic,
CASEexpressions, and concatenation all produce a new value:- Any aggregation
An aggregate anywhere in the expression means the column describes many input rows instead of one:
- A combination of several columns
The output column has more than one upstream column, so no single comment describes it:
- A cast that can lose information
Narrowing casts and casts across type families aren’t as-is:
- A transformation hidden inside a subquery
Following the projection into a derived table means a transformation can’t be disguised as a passthrough:
Statements that trigger propagation¶
The following statements start a propagation pass:
- Setting a column comment
The comment is applied to the as-is downstream columns that propagation reaches.
- Unsetting a column comment
The copies that were propagated from this column downstream are cleared.
- Creating a view, materialized view, or dynamic table
Each column created without a comment inherits the comment of the nearest upstream column that has one.
CREATE OR REPLACEre-runs this inheritance against the new definition.- Creating a view, materialized view, or dynamic table with an inline column comment
The column you comment inline becomes a source, and its comment propagates to the as-is columns downstream of it.
Propagation behavior¶
- Comments flow from upstream to downstream only. Setting a comment on a column propagates to every as-is column downstream of it recursively.
- A user-written comment is never overwritten. Downstream propagation along a lineage path stops as soon as it reaches a column that carries a user comment.
- A new user comment overrides the propagated comments downstream of it. The column becomes the source for its own branch of the lineage graph.
Find out where a comment came from¶
Every column comment carries an apply method that records whether a user wrote it or propagation applied it. You can read it in Snowsight or with a system function.
In Snowsight¶
Open the Columns tab for a table, view, or dynamic table. Each column’s description shows an icon that identifies its origin:
- A user icon, with the tooltip User generated, means the comment was written on that column.
- A propagation icon, with the tooltip Propagated from upstream, means the comment arrived by propagation.
A column with no comment shows no icon. The Columns tab doesn’t show the icon for a materialized view, so use the system function to inspect provenance for materialized view columns.
With SQL¶
Call SYSTEM$GET_COLUMN_COMMENT_PROPAGATION_SOURCE with the fully qualified name of a column. It returns the column whose comment a user wrote, or NULL when the comment wasn’t propagated:
For the cases that return NULL and the privileges the function requires, see SYSTEM$GET_COLUMN_COMMENT_PROPAGATION_SOURCE.
Usage notes¶
- Propagation requires
BY_NAMElineage recorded in October 2026 or later. Comments don’t propagate along lineage that Snowflake recorded before this date, even after you enable the feature. To bring an existing view, materialized view, or dynamic table into propagation, re-create it withCREATE OR REPLACEso that Snowflake records its lineage again. - Propagation is asynchronous and best effort. Propagated changes can take up to 10 minutes to appear on downstream columns. It runs after the transaction that sets or unsets a comment, so your DDL statement doesn’t wait for it and DDL latency stays the same.
- A DDL statement can succeed even if propagation later fails. Because propagation runs outside the transaction, Snowflake commits the comment you set before propagation runs. An internal error can then interrupt propagation without affecting the committed comment. To retry, rerun the DDL statement that sets or unsets the source comment.
Examples¶
The following example builds a small lineage graph and walks a comment through it. Every column in the graph is an as-is
projection of orders.order_id.
-
Create a table, a dynamic table that reads it, a view on that dynamic table, and a second view that reads the table directly. The dynamic table needs an existing warehouse, named
my_whhere: -
Comment the column on the table:
-
Comment the same column on the intermediate dynamic table:
-
Change the comment on the table:
-
Create another view on the table: