Skip to content

insert into db.tbl_z select * from db.tbl_x with MetaDataProvider error #635

@gitforzzj

Description

@gitforzzj

Describe the bug

  • When the column of the target table are different from the columns of the source table, the generated column are lineage, and the column of the target table are still generated from the source table

SQL
Paste the SQL text here. For example:

insert into db.tbl_z  select *  from db.tbl_x 

API (Application Programming Interface): provide the python code you're using and the output.
For example:

providers = generate_metadata_providers(
    {
        "db.tbl_x": ["id", "a", "b"],
        "db.tbl_z": ["pk", "s", "t"],
    }
)


@pytest.mark.parametrize("provider", providers)
def test_select_single_table_wildcard(provider: MetaDataProvider):
    sql = """insert into db.tbl_z
    select *
    from db.tbl_x 
    """
    assert_column_lineage_equal(
        sql,
        [
            (
                ColumnQualifierTuple("id", "db.tbl_x"),
                ColumnQualifierTuple("id", "db.tbl_z"),
            ),
            (
                ColumnQualifierTuple("a", "db.tbl_x"),
                ColumnQualifierTuple("a", "db.tbl_z"),
            ),
            (
                ColumnQualifierTuple("b", "db.tbl_x"),
                ColumnQualifierTuple("b", "db.tbl_z"),
            ),
        ],
        metadata_provider=provider
    )

Expected behavior

{(db.tbl_x.b, db.tbl_z.t), (db.tbl_x.id, db.tbl_z.pk), (db.tbl_x.a, db.tbl_z.s)}

actual:
{(db.tbl_x.b, db.tbl_z.b), (db.tbl_x.id, db.tbl_z.id), (db.tbl_x.a, db.tbl_z.a)}

Python version (available via python --version)

  • 3.9.18

SQLLineage version (available via sqllineage --version):

  • 1.5.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions