-
Notifications
You must be signed in to change notification settings - Fork 247
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
Metadata wrongly used in INSERT INTO statement column lineage #648
Comments
Can you provide some additional info on They're referring to variable that doesn't exist so I cannot reproduce your case. Also DummyMetaDataProvider is supposed to accept dict as input, not set. |
Sorry, for my mistake. I guess it should be {"analyze":"a", "analyze"':"b", "analyze":"c"}. Just definition of table analyze with three columns, a, b and c. |
Seems I still can't reproduce it. Here's the changed runnable python script: from sqllineage.runner import LineageRunner
from sqllineage.core.metadata.dummy import DummyMetaDataProvider
with open("test.sql") as f:
sql = f.read()
result = LineageRunner(sql, metadata_provider = DummyMetaDataProvider({"analyze": ["a", "b", "c"]}))
print(result.get_column_lineage()) with the sql you provided, the output is as expected.
|
Found my old code to test it more. The issue is only there with owner/schema being included.
|
Well I don't see how output could be like this, where c and b are not correct mapping:
It's consistently the result below with lineage being correct and order being a,b,c:
Or do you expect the lineage like above and the order being a,c,b?
|
I don´t think you added owner/schema. In your last result there is still "default.analyze". My result look like this:
|
Oh, I see it now! Thanks. Let me spend some time to figure it out tomorrow. |
Great! Thanks a lot. Sorry for the non-executable code. |
It turns out this is already fixed in master branch. I will release v1.5.4 today. |
Describe the bug
SQL
To Reproduce
Note here we refer to SQL provided in prior step as stored in a file named
test.sql
For example:
Output:
Expected behavior
The INSERT INTO statement with a list of columns should map columns by name, not by order. The expected lineage should correctly map as follows:
This result is consistent with the behavior when the metadata provider is omitted.
Python version (available via
python --version
)SQLLineage version (available via
sqllineage --version
):Additional context
I tested the SQL behavior on Oracle, and it correctly inserts values by column names, not by order.
The text was updated successfully, but these errors were encountered: