REFRESH LINEAGE
Backfills or reconciles lineage for existing views in the default catalog. Use this command after enabling data lineage on a deployment that already contains views. Views created after lineage is enabled are tracked automatically.
This command requires the global SUPER privilege and lineage must be enabled. See Data Lineage.
Syntax
REFRESH LINEAGE FOR ALL VIEWS [ DRY RUN ]
DRY RUN calculates and reports the changes without writing them. Run it first to review the work that a refresh would perform.
Output Columns
Successful views with no changes are omitted from the result.
Examples
Preview the changes required for existing views:
REFRESH LINEAGE FOR ALL VIEWS DRY RUN;
Apply the changes:
REFRESH LINEAGE FOR ALL VIEWS;
After the command completes, query a view's upstream lineage with GET_LINEAGE:
SELECT
distance,
source_object_database,
source_object_name,
target_object_database,
target_object_name
FROM GET_LINEAGE(
'lineage_demo.sales_view',
'VIEW',
'UPSTREAM',
1
);