LineageHolder is an abstraction to hold the lineage result analyzed by LineageAnalyzer at different level.
At the bottom, we have
sqllineage.core.holder.SubQueryLineageHolder to hold lineage at subquery level.
This is used internally for
sqllineage.core.analyzer.LineageAnalyzer, which generate
sqllineage.core.holder.StatementLineageHolder as the result of lineage at SQL statement level.
And to assemble multiple
sqllineage.core.holder.StatementLineageHolder into a DAG based data structure serving
for the final output, we have
- class sqllineage.core.holders.SubQueryLineageHolder
SubQuery/Query Level Lineage Result.
SubQueryLineageHolder will hold attributes like read, write, cte
Each of them is a Set[
This is the most atomic representation of lineage result.
- class sqllineage.core.holders.StatementLineageHolder
Statement Level Lineage Result.
Based on SubQueryLineageHolder, StatementLineageHolder holds extra attributes like drop and rename
For drop, it is a Set[
For rename, it a Set[Tuple[
sqllineage.models.Table]], with the first table being original table before renaming and the latter after renaming.
- class sqllineage.core.holders.SQLLineageHolder(graph: DiGraph)
The combined lineage result in representation of Directed Acyclic Graph.
graph – the Directed Acyclic Graph holding all the combined lineage result.
- property table_lineage_graph: DiGraph
The table level DiGraph held by SQLLineageHolder
- property column_lineage_graph: DiGraph
The column level DiGraph held by SQLLineageHolder