cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Lineage & Query history table

MadMax_71_2
New Contributor II

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?

1 ACCEPTED SOLUTION

Accepted Solutions

szymon_dybczak
Esteemed Contributor III
2 REPLIES 2

szymon_dybczak
Esteemed Contributor III

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

This really helpful, much appreciated!