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

No column-level lineage for T-SQL MERGE statement #579

Open
tsitsimis opened this issue Feb 16, 2024 · 4 comments
Open

No column-level lineage for T-SQL MERGE statement #579

tsitsimis opened this issue Feb 16, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@tsitsimis
Copy link

tsitsimis commented Feb 16, 2024

Describe the bug
Column-level lineage does not identify tables within sub-queries used in the USING part of a MERGE statement (T-SQL)

SQL

MERGE INTO s1.table_target AS T 
USING (
    SELECT
        src.key_col    AS key_col
        ,src.col1       AS col1
    FROM  s1.table_source AS  src
) AS S 

    ON T.key_col  = S.key_col
WHEN NOT MATCHED 
THEN INSERT (       
    col1
)
VALUES (
    S.col1  
)

To Reproduce
Web UI (Web User Interface):
image

Expected behavior
The graph should also show lineage from S (alias) to s1.table_target

@tsitsimis tsitsimis added the bug Something isn't working label Feb 16, 2024
@reata
Copy link
Owner

reata commented Feb 18, 2024

What's the sqllineage version you're using? The latest v1.5.1 release works fine for this case.

@reata reata added the question Further information is requested label Feb 18, 2024
@tsitsimis
Copy link
Author

It works! Thank you!

@tsitsimis
Copy link
Author

tsitsimis commented Mar 8, 2024

Re-opening since while it works for ansi dialect, it does not for tsql and I'm wondering if this is expected. (sqllineage v1.5.1)

result = LineageRunner(query, dialect="tsql")
print(result.get_column_lineage())

@tsitsimis tsitsimis reopened this Mar 8, 2024
@reata
Copy link
Owner

reata commented Mar 10, 2024

Not expected. We need to fix this.

@reata reata removed the question Further information is requested label May 20, 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

2 participants