Skip to main content

Lineage full export

Use Lakehouse to export a unified view of lineage that you can reuse across impact analysis, dashboard impact, root cause analysis, and other lineage use cases.

Before you begin

Before you run these queries, make sure:

Full lineage export

The following query joins GOLD.FULL_LINEAGE with GOLD.ASSET_LOOKUP_TABLE to include owners, certificate status, and connectors for the start and related assets.

The query returns lineage rows for assets updated in the last 2 days, including upstream and downstream dependencies. Use it to monitor recent updates, identify downstream dependencies for impact analysis, trace upstream sources during root cause investigations, and validate lineage changes after deployments.

The output includes the depth of each connection, which helps distinguish direct and indirect dependencies.

SELECT 
A.GUID, -- Starting asset's unique identifier
A.ASSET_NAME, -- Starting asset name (e.g., DIM_CUSTOMERS)
A.ASSET_QUALIFIED_NAME, -- Full path including connection/database/schema
A.ASSET_TYPE, -- Asset type (Table, View, Dashboard, etc.)
TO_TIMESTAMP_LTZ(A.UPDATED_AT / 1000) AS LAST_UPDATED, -- Convert epoch milliseconds to timestamp
DATEDIFF(
day,
TO_TIMESTAMP_LTZ(A.UPDATED_AT / 1000),
CURRENT_TIMESTAMP()
) AS DAYS_SINCE_UPDATE, -- Number of days since last update
L.START_NAME, -- Lineage start point name
L.START_TYPE, -- Type at lineage start
L.RELATED_NAME, -- Related asset name in the lineage path
L.RELATED_TYPE, -- Related asset type (Table, Dashboard, etc.)
L.DIRECTION, -- UPSTREAM (sources) or DOWNSTREAM (consumers)
L.LEVEL -- Depth in lineage (1=direct, 2=2-hops, etc.)
FROM ASSETS A
INNER JOIN LINEAGE L
ON A.GUID = L.START_GUID -- Join on asset identifier
WHERE
A.HAS_LINEAGE -- Only include assets with lineage relationships
AND A.CONNECTOR_NAME IN ('snowflake', 'redshift', 'bigquery') -- Focus on major data warehouses
AND DATEDIFF(
day,
TO_TIMESTAMP_LTZ(A.UPDATED_AT / 1000), -- Convert epoch milliseconds to timestamp
CURRENT_TIMESTAMP()
) <= 2 -- Only assets updated within last 2 days
GROUP BY
A.GUID, A.ASSET_NAME, A.ASSET_QUALIFIED_NAME, A.ASSET_TYPE,
A.UPDATED_AT,
L.START_NAME, L.START_TYPE, L.RELATED_NAME, L.RELATED_TYPE,
L.DIRECTION, L.LEVEL
ORDER BY
A.UPDATED_AT DESC, -- Most recently updated first
A.ASSET_QUALIFIED_NAME, -- Then group by asset
L.DIRECTION, -- Show upstream first, then downstream
L.LEVEL -- Order by proximity (closest first)
LIMIT 200;
Sample output
ASSET_NAMEASSET_TYPERELATED_NAMERELATED_TYPEDIRECTIONLEVEL
ACCOUNT_IDColumnACCOUNT_IDPowerBIColumnDOWNSTREAM1
ASSESSMENT_IDColumnASSESSMENT_IDPowerBIColumnDOWNSTREAM1
CREDIT_LIMITColumnCREDIT_LIMITPowerBIColumnDOWNSTREAM1
CREDIT_SCOREColumnCREDIT_SCOREPowerBIColumnDOWNSTREAM1
CREDIT_SCOREColumnExecutive OverviewPowerBIPageDOWNSTREAM2
CURRENT_BALANCEColumnCURRENT_BALANCEPowerBIColumnDOWNSTREAM1
CUSTOMER_IDColumnCUSTOMER_IDPowerBIColumnDOWNSTREAM1
CUSTOMER_IDColumnExecutive OverviewPowerBIPageDOWNSTREAM2
DEBT_TO_INCOME_RATIOColumnDEBT_TO_INCOME_RATIOPowerBIColumnDOWNSTREAM1
EXPOSURE_AT_DEFAULTColumnEXPOSURE_AT_DEFAULTPowerBIColumnDOWNSTREAM1
PROBABILITY_OF_DEFAULTColumnPROBABILITY_OF_DEFAULTPowerBIColumnDOWNSTREAM1
RECENT_INQUIRIESColumnRECENT_INQUIRIESPowerBIColumnDOWNSTREAM1
RISK_GRADEColumnRISK_GRADEPowerBIColumnDOWNSTREAM1
LAST_UPDATEColumnLast UpdateSigmaDataElementFieldDOWNSTREAM1
CART_TAXTableosha_inspectionTableDOWNSTREAM1