Analyzer
LineageAnalyzer is an abstract class, supposed to include the core processing logic for one-statement SQL analysis.
Each parser implementation will inherit LineageAnalyzer and do parser specific analysis based on the AST they generates
and store the result in StatementLineageHolder.
LineageAnalyzer
- class sqllineage.core.analyzer.LineageAnalyzer(sql: str, **_)[source]
SQL Statement Level Lineage Analyzer Parser specific implementation should inherit this class and implement analyze method
- Parameters:
sql – a string representation of single or multiple SQL statements
- abstract property statements: list[str]
Split the raw SQL into individual statements. :return: list of individual statement strings
- abstractmethod analyze(sql: str, metadata_provider: MetaDataProvider) StatementLineageHolder[source]
to analyze single statement sql and store the result into StatementLineageHolder.
- Parameters:
sql – single-statement SQL string to be processed
metadata_provider –
sqllineage.core.metadata_provider.MetaDataProviderprovides metadata on tables to help lineage analyzing
- Returns: