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

Misidentify Binary Operator * As Wildcard #485

Closed
maoxingda opened this issue Nov 30, 2023 · 1 comment · Fixed by #510
Closed

Misidentify Binary Operator * As Wildcard #485

maoxingda opened this issue Nov 30, 2023 · 1 comment · Fixed by #510
Labels
bug Something isn't working

Comments

@maoxingda
Copy link
Contributor

insert into
    public.tgt_tbl1
(
    id
)
select
    nvl(src_tbl1.id, 0) * 1 as id
from
    public.src_tbl1 as src_tbl1
;

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

with open(sql_file, 'r') as f:
    sql = f.read()

lr = LineageRunner(sql, dialect='redshift')

lr.print_column_lineage()
public.tgt_tbl1.id <- public.src_tbl1.*
public.tgt_tbl1.id <- public.src_tbl1.id

Expected behavior

public.tgt_tbl1.id <- public.src_tbl1.id

Python version (available via python --version)

  • 3.11.5

SQLLineage version (available via sqllineage --version):

  • 1.4.8

The lineage of the two variants of SQL is also incorrect.

insert into
    public.tgt_tbl1
(
    id
)
select
    coalesce(src_tbl1.id, 0) * 1 as id
from
    public.src_tbl1 as src_tbl1
;
insert into
    public.tgt_tbl1
(
    id
)
select
    case when src_tbl1.id is not null then src_tbl1.id else 0 end * 1 as id
from
    public.src_tbl1 as src_tbl1
;
@maoxingda maoxingda added the bug Something isn't working label Nov 30, 2023
@reata reata changed the title Incorrect column lineage Misidentify Binary Operator * As Wildcard Dec 3, 2023
@reata
Copy link
Owner

reata commented Dec 3, 2023

Yes this is a bug when binary operator * is misidentified as wildcard. We should get it fixed.

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