Querying lineage with SQL using the lineage system table
The lineage system table stores each lineage event as a row in a read-only Apache Iceberg table in your account. Use it for audits, fleet-wide analysis, and to keep lineage history for a long retention.
About the lineage system table
-
Location. The
eventstable in thelineagenamespace of the AWS managedaws-catalogtable bucket in Amazon S3 Tables. In SQL, reference it as"s3tablescatalog/aws-catalog"."lineage"."events". -
Grain. One row for each OpenLineage event. A single job run usually has several rows, such as
STARTandCOMPLETE, which share arun_id. -
Freshness. New events typically appear within about 5 minutes.
-
Default. Off. When you turn it on, the table also receives the earlier lineage events that are still within the raw event retention period, then records new events as they arrive.
-
Read-only. No principal in your account can change or delete a record, including administrators. An administrator can still delete the whole table with the Amazon S3 Tables
delete-tableoperation. -
Retention. Records don't expire by default. To set a retention period, use the Amazon S3 console or the AWS CLI (
put-table-record-expiration-configuration). Amazon S3 Tables then removes older records automatically. -
Partitioning. Partitioned by
day(event_time). Filter onevent_timein every query. -
Encryption. SSE-S3 by default, or a customer managed AWS KMS key.
What you can answer
-
Which roles and users wrote to a table, and which jobs read from it.
-
Who created, changed, or dropped a table.
-
Which columns of a table a job read or wrote.
-
Which jobs failed in a time window, with error details.
-
Row counts, data size, duration, and memory for a run.
-
Activity on a table broken down by engine.
Considerations
-
Duplicates. If a batch of events is delivered more than once, the table can contain duplicate rows. To count events exactly, deduplicate on
event_subject_idandevent_time. -
Late events. Set retention longer than the worst-case delivery delay, so late events aren't removed.
-
Turning off. If you turn off the system table, no new events are written, and existing records stay queryable until your retention period removes them. When you turn it on again, the table also receives the events posted while it was off that are still within the raw event retention period.