Skip to content

Latest commit

 

History

History
89 lines (48 loc) · 5.43 KB

File metadata and controls

89 lines (48 loc) · 5.43 KB
graph LR
    sqllineage_core_parser["sqllineage.core.parser"]
    sqllineage_core_parser_sqlfluff_analyzer_analyze["sqllineage.core.parser.sqlfluff.analyzer.analyze"]
    sqllineage_core_parser_sqlfluff_models_of["sqllineage.core.parser.sqlfluff.models.of"]
    sqllineage_core_parser_sqlfluff_extractors["sqllineage.core.parser.sqlfluff.extractors"]
    sqllineage_core_parser_sqlparse_analyzer_analyze["sqllineage.core.parser.sqlparse.analyzer.analyze"]
    sqllineage_core_parser_sqlparse_models_of["sqllineage.core.parser.sqlparse.models.of"]
    sqllineage_core_parser_sqlparse_handlers["sqllineage.core.parser.sqlparse.handlers"]
    sqllineage_core_parser -- "calls" --> sqllineage_core_parser_sqlfluff_analyzer_analyze
    sqllineage_core_parser -- "calls" --> sqllineage_core_parser_sqlparse_analyzer_analyze
    sqllineage_core_parser_sqlfluff_analyzer_analyze -- "passes output to" --> sqllineage_core_parser_sqlfluff_models_of
    sqllineage_core_parser_sqlparse_analyzer_analyze -- "passes output to" --> sqllineage_core_parser_sqlparse_models_of
    sqllineage_core_parser_sqlfluff_analyzer_analyze -- "delegates to" --> sqllineage_core_parser_sqlfluff_extractors
    sqllineage_core_parser_sqlparse_analyzer_analyze -- "delegates to" --> sqllineage_core_parser_sqlparse_handlers
Loading

CodeBoardingDemoContact

Details

The SQL Parser subsystem is primarily encapsulated within the sqllineage.core.parser package. This package serves as the entry entry point and abstraction layer for all SQL parsing functionalities, adhering to the "Plugin/Extension" architectural pattern by allowing different parser backends to be integrated.

sqllineage.core.parser

The core abstraction and entry point for SQL parsing. It defines the contract for parsing and acts as a dispatcher, selecting and delegating to specific parser implementations (e.g., sqlfluff or sqlparse) based on configuration or SQL dialect. This aligns with the "Plugin/Extension" pattern, allowing for interchangeable parser backends.

Related Classes/Methods:

sqllineage.core.parser.sqlfluff.analyzer.analyze

The primary orchestrator for analyzing SQL queries using the sqlfluff library. It initiates the sqlfluff-specific parsing process and coordinates subsequent steps for lineage extraction.

Related Classes/Methods:

sqllineage.core.parser.sqlfluff.models.of

Responsible for transforming the raw parsed segments from sqlfluff into structured lineage model objects. This component extracts key information like columns and aliases from the sqlfluff parse tree.

Related Classes/Methods:

sqllineage.core.parser.sqlfluff.extractors

Handles the extraction of lineage information from specific types of SQL statements (e.g., CREATE, INSERT, SELECT) within the sqlfluff context. It applies rules to identify source and target entities.

Related Classes/Methods:

sqllineage.core.parser.sqlparse.analyzer.analyze

The primary orchestrator for analyzing SQL queries using the sqlparse library. Similar to its sqlfluff counterpart, it initiates the sqlparse-specific parsing and dispatches to handlers.

Related Classes/Methods:

sqllineage.core.parser.sqlparse.models.of

Transforms sqlparse tokens into structured lineage model objects, specifically focusing on extracting source column information.

Related Classes/Methods:

sqllineage.core.parser.sqlparse.handlers

Manages the processing of source-related SQL constructs, identifying and processing columns and tables within the sqlparse context. These handlers are specialized for different SQL statement types.

Related Classes/Methods: