Skip to content

Latest commit

 

History

History
88 lines (47 loc) · 5.05 KB

File metadata and controls

88 lines (47 loc) · 5.05 KB
graph LR
    Metadata_Provider["Metadata Provider"]
    get_table_columns["get_table_columns"]
    _get_table_columns["_get_table_columns"]
    MetaDataSession["MetaDataSession"]
    session["session"]
    register_session_metadata["register_session_metadata"]
    deregister_session_metadata["deregister_session_metadata"]
    get_table_columns -- "delegates to" --> _get_table_columns
    MetaDataSession -- "utilizes" --> register_session_metadata
    MetaDataSession -- "utilizes" --> deregister_session_metadata
    session -- "manages" --> MetaDataSession
    click Metadata_Provider href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/sqllineage/Metadata_Provider.md" "Details"
Loading

CodeBoardingDemoContact

Details

The Metadata Provider subsystem is a critical part of sqllineage.core, specifically implemented within the sqllineage/core/metadata_provider.py file. It serves as an extensible component responsible for fetching and managing external metadata about tables and columns, which is vital for resolving ambiguous references and expanding wildcards in SQL queries.

Metadata Provider [Expand]

The overarching component providing external metadata about tables and columns, crucial for resolving ambiguous references and expanding wildcards by fetching schema information from external sources. It acts as a key extension point for integrating various metadata backends.

Related Classes/Methods:

get_table_columns

This is the public API for the Metadata Provider. It offers a standardized interface for other parts of the system (e.g., the Lineage Analyzer) to retrieve column details for a given table, abstracting the underlying metadata fetching mechanism.

Related Classes/Methods:

_get_table_columns

An internal helper method that encapsulates the core logic for fetching table columns from external sources. This separation of concerns allows for potential pluggability of different metadata backends, aligning with the Plugin/Extension architectural pattern.

Related Classes/Methods:

MetaDataSession

Central to managing contextual and temporary metadata. It enables the system to handle session-specific overrides or additions to metadata, which is vital for extensibility and dynamic query analysis, supporting the CQRS pattern by managing query-specific metadata context.

Related Classes/Methods:

session

Acts as a context manager or factory for MetaDataSession instances. It ensures proper setup and teardown of metadata contexts, providing a clean interface for managing the lifecycle of metadata sessions.

Related Classes/Methods:

register_session_metadata

Responsible for adding or overriding session-specific metadata onto a stack. This mechanism enables dynamic and contextual metadata management, allowing the system to adapt to different query environments or user-defined schemas.

Related Classes/Methods:

deregister_session_metadata

Handles the removal of session-specific metadata from the stack. This is typically used for cleanup when a session concludes, ensuring that temporary metadata does not persist beyond its scope.

Related Classes/Methods: