Lineage from Databricks Unity Catalog
An AWS Glue crawler can collect table and column lineage from Databricks Unity Catalog and add it to your lineage graph. The crawler reads the Unity Catalog lineage system tables through a SQL warehouse, so you don't install anything on your Databricks clusters.
How it works
On each scheduled run, the crawler queries system.access.table_lineage and
system.access.column_lineage for new records, converts them to OpenLineage
events, and sends them to AWS Glue Data Catalog. The crawler also reads
system.information_schema.columns and system.query.history.
-
First run. Collects the last 7 days of lineage.
-
Later runs. Collect from the end of the previous run up to two hours before the current time, so the crawler picks up late records on the next run.
-
Gaps. If a run fails repeatedly, the crawler skips lineage older than 7 days.
Each crawl run reads query history up to two hours before the current time, because Databricks can take an hour or more to populate query history records.
Prerequisites
In Databricks, an administrator does the following once:
-
Enable the
system.accessschema. -
Create a service principal with an OAuth secret.
-
Grant the service principal
SELECTonsystem.access.table_lineageandsystem.access.column_lineage, andCAN USEon a SQL warehouse. -
Add the service principal to the account-level
databricks_pii_accessgroup. This is required; without it, statements in query history are redacted.
To grant the service principal access to the system tables, run the following statements:
-
Grant access to the system catalog:
GRANT USE CATALOG ON CATALOG system TOprincipal; -
Grant access to the schema and all tables in it:
GRANT USE SCHEMA, SELECT ON SCHEMA system.schemaTOprincipal; -
Grant SELECT on a specific table:
GRANT SELECT ON TABLE system.schema.tableTOprincipal;
Replace principal with the service principal's application ID,
schema with the system schema (for example,
access), and table with the table name (for example,
table_lineage).
Set up lineage collection
To set up lineage collection, do the following:
-
Store the OAuth client secret in AWS Secrets Manager.
-
Create an AWS Glue connection of type
DATABRICKSwith the workspace URL, SQL warehouse, secret ARN, and an Amazon S3 spill location. -
Create a crawler on the connection with lineage collection turned on, and set a schedule. Hourly is recommended.
-
Give the crawler's IAM role
glue:PostLineageEvent,glue:GetConnection, andsecretsmanager:GetSecretValueon the secret.
Considerations
For limitations, see Considerations.