Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gitforzzj opened this issue Jul 2, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@gitforzzj
Copy link

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
@gitforzzj gitforzzj added the bug Something isn't working label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant