- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2026 02:30 AM
Hi,
I’m trying to perform a join between the Lineage and Query History system tables. Initially, I assumed statement_id could be used as the join key, but that didn’t seem correct. I then noticed that joining statement_id with entity_run_id also appears to work, since both columns contain the same values - and in cases where statement_id is null, entity_run_id still has valid entries.
Can anyone confirm what key you used to join these two tables?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2026 05:00 AM
Hi @MadMax_71_2 ,
Check ERD diagram. Here you should find what's the correct key:
docs.databricks.com/aws/en/assets/images/system-tables-erd-690b80220d077015a023f90d59ff7560.svg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2026 06:01 AM
This really helpful, much appreciated!