system.access.table_lineage - source and target table meanings

eriodega
Contributor

I've been using the system.access.table_lineage table, and I'm trying to understand when the source and target tables are defined.
For example, picking a specific job run and looking at the lineage:

select
source_type,
source_table_full_name,
target_type,
target_table_full_name
from system.access.table_lineage
where 1=1
and entity_id = 279912916130857 and entity_run_id = 335708887601361
order by event_time DESC
LIMIT 1000;

I see a few scenarios:

  1. source_type = null and target_type =TABLE (I think this is a write to the table)
  2. source_type = TABLE, target_type = null (I think this is a read of a table)
  3. source_type = TABLE (table X), target_type = TABLE (table Y) - I don't know what this is
  4. source_type = VIEW, target_type = TABLE - I don't know what this is
  5. source_type = TABLE, target_type = VIEW (I think this is a read of the "target" view, indicating it then reads from the "source" of the table)

I looked over the documentation in

DESCRIBE TABLE EXTENDED system.access.table_lineage

but it did not help with my understanding.