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

subquery mistake alias as table name in visualiztion #512

Closed
shengkui opened this issue Dec 25, 2023 · 2 comments · Fixed by #514
Closed

subquery mistake alias as table name in visualiztion #512

shengkui opened this issue Dec 25, 2023 · 2 comments · Fixed by #514
Labels
bug Something isn't working

Comments

@shengkui
Copy link

Describe the bug

Alias of a subquery show as a Table node in Visualizes Table/Column Lineage

SQL

CREATE TABLE main.tab1 AS (
  SELECT * FROM (
    SELECT T0.* FROM (SELECT * FROM main.tab0) T0 WHERE T0.num < 100
  )
)

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

sqllineage -f test.sql --dialect=ansi -g

Web UI (Web User Interface):

alias_table

Expected behavior

There should be no table node for alias of subquery.

Python version (available via python --version)

  • 3.10.13

SQLLineage version (available via sqllineage --version):

  • 1.4.9
@shengkui shengkui added the bug Something isn't working label Dec 25, 2023
@reata
Copy link
Owner

reata commented Dec 25, 2023

Bug confirmed. Thanks for reporting.

The column lineage is also incorrect in this case.

@reata
Copy link
Owner

reata commented Dec 26, 2023

This is a regression issue introduced in v1.4.9 via fbad73a, v1.4.8 was OK.

The commit is to make subquery alias case insensitive. So that we can resolve SELECT t0.* FROM (SELECT * FROM main.tab0) T0 correctly.

But that was only half done. Qualifier name was not converted to lower case correctly.

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

Successfully merging a pull request may close this issue.

2 participants