Accounts and Security · Topic 8 of 17

Data Lineage, Dependencies and Object Tagging

Trace data with Snowflake lineage, OBJECT_DEPENDENCIES and ACCESS_HISTORY, and classify it with object tags, inheritance, propagation and tag policies.

  • 5 min
In a nutshell
  • Lineage graph and SNOWFLAKE.CORE.GET_LINEAGE give upstream and downstream with column detail; needs VIEW LINEAGE; Enterprise or higher.
  • OBJECT_DEPENDENCIES is static structure; ACCESS_HISTORY is runtime usage (direct, base, modified objects).
  • Tags: schema level objects, up to 50 per object, inherited downward, optional ALLOWED_VALUES.

What it is

Governance needs two kinds of knowledge: where data came from and where it goes, and what the data is. Lineage and dependency tracking answer the first question. Object tags answer the second, and they are also the hook that policies use to act automatically.

An Architect uses lineage for impact analysis ("what breaks if I change this column?") and audits ("who read this table?"), and uses tags to mark sensitive data once and have masking follow it.

Sourcesflow throughTables and viewstransformationsshown byLineage graphupstream and downstreamtagged withObject tagssensitivity, ownerdrivePolicies

How it works

Lineage in Snowsight

The Lineage tab in Snowsight shows a graph of upstream sources and downstream consumers for an object, down to the column level. It works for table like objects such as tables, views, materialized views, dynamic tables, external tables and Iceberg tables, and it records operations such as COPY INTO, CREATE TABLE AS SELECT, INSERT ... SELECT, MERGE, UPDATE, CREATE VIEW and cloning. It requires Enterprise Edition or higher.

To view lineage a role needs the VIEW LINEAGE privilege on the account, which PUBLIC holds by default. It also needs privileges on the objects (SELECT, or REFERENCES to see lineage without data access) and USAGE on their database and schema. The function SNOWFLAKE.CORE.GET_LINEAGE returns lineage programmatically.

SELECT *
FROM TABLE(SNOWFLAKE.CORE.GET_LINEAGE(
  'SALES.PUBLIC.ORDERS_SUMMARY', 'TABLE', 'UPSTREAM', 3));

The arguments are the object name, its domain, the direction (UPSTREAM or DOWNSTREAM) and the distance in hops.

Dependencies

Object dependencies are the static links between objects, such as a view that selects from a table or a function that calls another. The SNOWFLAKE.ACCOUNT_USAGE.OBJECT_DEPENDENCIES view lists each referencing object and the object it references.

SELECT referencing_object_name, referenced_object_name
FROM SNOWFLAKE.ACCOUNT_USAGE.OBJECT_DEPENDENCIES
WHERE referenced_object_name = 'ORDERS';

Use it before dropping or altering an object: the rows show which views and functions would break.

Access history

SNOWFLAKE.ACCOUNT_USAGE.ACCESS_HISTORY records, per query, what was read and written. It requires Enterprise Edition or higher.

ColumnContains
direct_objects_accessedObjects named in the query, such as a view
base_objects_accessedThe underlying tables and columns behind views
objects_modifiedObjects (and columns) the query wrote to
user_name, query_start_timeWho ran it and when

Together with QUERY_HISTORY, it supports audits ("who read the SSN column last month?") and shows column level data flow into target tables.

SourceAnswersLevel
Lineage graph and GET_LINEAGEWhere did this come from, what uses itTable and column
OBJECT_DEPENDENCIESWhat references this objectObject
ACCESS_HISTORYWho read or wrote what, and whenQuery, table, column
Exam tip

"What breaks if I change this view" points to OBJECT_DEPENDENCIES or the lineage downstream graph. "Which users read this sensitive column" points to ACCESS_HISTORY.

Object tagging

A tag is a schema level object that holds a name and a string value you attach to other objects. Tags describe data without changing it.

CREATE TAG governance.tags.pii ALLOWED_VALUES 'email', 'ssn', 'phone';
ALTER TABLE customers MODIFY COLUMN email SET TAG governance.tags.pii = 'email';
ALTER TABLE customers SET TAG governance.tags.cost_center = 'sales';

SELECT SYSTEM$GET_TAG('governance.tags.pii', 'customers.email', 'COLUMN');

Key properties:

  • Inheritance. A tag set on a parent applies to its children: a schema tag covers its tables, a table tag covers its columns, and an account tag reaches warehouses.
  • Limits. An object can carry up to 50 tags.
  • Allowed values. ALLOWED_VALUES restricts what can be assigned and keeps tagging consistent.
  • Propagation. Tags can follow the data automatically to views built on a tagged table and to tables created by CTAS or similar. Propagation requires Enterprise Edition or higher.
  • Privileges. CREATE TAG on the schema creates tags; APPLY TAG (on the account or on one tag) applies them. Tag administration is usually given to a governance role.
  • Tag based masking. Attach a masking policy to a tag and every column carrying it with a matching data type is masked (Enterprise Edition or higher).
  • Discovery. SNOWFLAKE.ACCOUNT_USAGE.TAG_REFERENCES and the INFORMATION_SCHEMA tag reference functions list tagged objects; the apply_method shows whether a tag was set manually, propagated or applied by classification.
Classificationdetects PIIsetsTag on columnPIIinherited or propagated toViews and copiesmasked byTag based masking policy

Classification can detect personal data automatically (for example with SYSTEM$CLASSIFY or classification profiles) and assign the Snowflake provided tags for semantic and privacy category. You then review and keep the result, and policies use the tags.

Watch out

Tagging describes data; it does not protect it. Without a masking, row access or similar policy bound to the tag, a tagged column is still fully readable.

Common mistakes

Believing a tag restricts access. Only policies and grants restrict access.

Tagging columns one at a time. Tag at table or schema level where it applies, and let inheritance do the work.

Expecting OBJECT_DEPENDENCIES to show who queried data. It shows structure, not usage. Use ACCESS_HISTORY.

Expecting lineage on a Standard account. Lineage and access history need Enterprise Edition or higher.

What to remember for the exam

  • Lineage graph and SNOWFLAKE.CORE.GET_LINEAGE give upstream and downstream with column detail; needs VIEW LINEAGE; Enterprise or higher.
  • OBJECT_DEPENDENCIES is static structure; ACCESS_HISTORY is runtime usage (direct, base, modified objects).
  • Tags: schema level objects, up to 50 per object, inherited downward, optional ALLOWED_VALUES.
  • Propagation and tag based masking need Enterprise Edition or higher; creating and setting tags works in all editions.
  • A tag documents; a policy enforces.

Check yourself

  • Which view tells you which users read a column last month?

    ACCESS_HISTORY, together with QUERY_HISTORY for query details.

  • A tag is set on a table. Do its columns carry it?

    Yes, tags are inherited by child objects, so every column of the table inherits it.

  • How do you mask all columns tagged as PII automatically?

    Set a masking policy on the tag; columns with that tag and a matching data type are masked.

Topic 8 of 17 in Accounts and Security

Test yourself on Accounts and Security

The full Snowflake ARA-C01 question bank has 687 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Snowflake. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.