Runner
LineageRunner is the entry point for SQLLineage core processing logic. After parsing command-line options, a string representation of SQL statements will be fed to LineageRunner for processing. From a bird’s-eye view, it contains three steps:
Calling
sqllineage.utils.helpers.split
function to split string-base SQL statements into a list ofstr
statements.Calling
sqllineage.core.analyzer.LineageAnalyzer
to analyze each one statement sql string. Get a list ofsqllineage.core.holders.StatementLineageHolder
.Calling
sqllineage.core.holders.SQLLineageHolder.of
function to assemble the list ofsqllineage.core.holders.StatementLineageHolder
into onesqllineage.core.holders.SQLLineageHolder
.
sqllineage.core.holders.SQLLineageHolder
then will serve for lineage summary, in text or in visualization
form.
sqllineage.runner.LineageRunner
- class sqllineage.runner.LineageRunner(sql: str, dialect: str = 'ansi', metadata_provider: ~sqllineage.core.metadata_provider.MetaDataProvider = <sqllineage.core.metadata.dummy.DummyMetaDataProvider object>, verbose: bool = False, silent_mode: bool = False, draw_options: ~typing.Dict[str, str] | None = None)[source]
The entry point of SQLLineage after command line options are parsed.
- Parameters:
sql – a string representation of SQL statements.
dialect – sql dialect
metadata_provider – metadata service object providing table schema
verbose – verbose flag indicating whether statement-wise lineage result will be shown
silent_mode – boolean flag indicating whether to skip lineage analysis for unknown statement types