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

Tsql -UPDATE set analyz error #592

Open
tianlulalala opened this issue Mar 26, 2024 · 1 comment
Open

Tsql -UPDATE set analyz error #592

tianlulalala opened this issue Mar 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@tianlulalala
Copy link

from sqllineage.runner import LineageRunner
sql = """
UPDATE a
SET a.ClaimReason=b.claimreason
FROM table1 as a
INNER JOIN table2 b
ON a.AccountID=b.AccountID
AND a.Product=b.Product
WHERE a.ClaimReason='NULL';
"""

res=LineageRunner(sql, dialect="tsql").print_table_lineage()

image

correct:
TARGERT_TABLE :.table1

sqlineage version :1.15.1

@tianlulalala tianlulalala added the bug Something isn't working label Mar 26, 2024
@reata
Copy link
Owner

reata commented Mar 26, 2024

This is very unconventional for tsql to allow table alias to be followed after UPDATE keyword. Ref: https://learn.microsoft.com/en-us/sql/t-sql/queries/update-transact-sql?view=sql-server-ver16

PostgreSQL and MySQL all require table name after UPDATE. Need to do more research on dialect supports.

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