Skip to content

Parse column level lineage incorrect #584

@maoxingda

Description

@maoxingda

SQL

insert into
    tgt_tbl1
(
    id
)
select
    sq.id
from
    (
        select
            src_tbl1.id
        from
            src_tbl1
            left join
                tgt_tbl1
            on
                src_tbl1.id = tgt_tbl1.id
        where
            tgt_tbl1.id is null
    ) as sq
;

To Reproduce

Note here we refer to SQL provided in prior step as stored in a file named test.sql

from sqllineage.runner import LineageRunner

with open("test.sql") as f:
    sql = f.read()

lr = LineageRunner(sql, dialect="redshift")

lr.print_column_lineage()

Actual behavior

Expected behavior

<default>.tgt_tbl1.id <- sq.id <- <default>.src_tbl1.id

Python version (available via python --version)

  • 3.10

SQLLineage version (available via sqllineage --version):

  • 1.5.1

Additional context

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