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

When parsing a segment of SQL, although the field-level relationships exist, the source table information is lost. #634

Open
xiaolongsoft opened this issue Jun 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@xiaolongsoft
Copy link

xiaolongsoft commented Jun 28, 2024

Describe the bug
When parsing a segment of SQL, although the field-level relationships exist, the source table information is lost.
existing table prefixes have also been replaced with "default.".

SQL
Paste the SQL text here. For example:

insert into foo.tb1  select f1,f2,(select f3 from  bar.tb1) b3 from  foo.tb2

For example:


MetaData = {"bar.tb1": ["f1", "f2", "f3"]}

provider = DummyMetaDataProvider(MetaData)

LineageRunner = sqllineage.runner.LineageRunner(sql, metadata_provider=provider, verbose=True)

LineageRunner.print_column_lineage()
print("=======source_tables:")
print(LineageRunner.source_tables)

result:

foo.tb1.b3 <- <default>.tb1.f3
foo.tb1.f1 <- foo.tb2.f1
foo.tb1.f2 <- foo.tb2.f2
=======source_tables:
[Table: foo.tb2]

Expected behavior
I hope to correctly display the prefix bar. for tb1.f3 and bar.tb1 in source_tables

Python version (available via python --version)

  • 3.8.17

SQLLineage version (available via sqllineage --version):

  • 1.5.3

Additional context
Add any other context about the problem here.

@xiaolongsoft xiaolongsoft added the bug Something isn't working label Jun 28, 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