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

adding type cast operator produces different results for redshift dialect #455

Closed
robertmatthewcook opened this issue Sep 21, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@robertmatthewcook
Copy link

>>> from sqllineage.runner import LineageRunner

>>> sql_1="insert into new_names SELECT (((fname) || ' ') || (lname)) AS full_name FROM names;"

>>> sql_2="insert into new_names SELECT (((fname)::text || ' '::text) || (lname)::text) AS full_name FROM names;"

>>> LineageRunner(sql_1, 'redshift').print_column_lineage()

<default>.new_names.full_name <- <default>.names.fname

<default>.new_names.full_name <- <default>.names.lname

>>> LineageRunner(sql_2, 'redshift').print_column_lineage()

<default>.new_names.full_name <- <default>.names.fname

>>> 
@reata
Copy link
Owner

reata commented Sep 30, 2023

Thanks for reporting it. Bug confirmed. It's triggered when type cast used together with parenthesis.

I tried removing all parenthesis and it's working fine.

insert into new_names SELECT fname::text || ' '::text || lname::text AS full_name FROM names;
$ sqllineage -f test.sql --dialect=redshift -l column
<default>.new_names.full_name <- <default>.names.fname
<default>.new_names.full_name <- <default>.names.lname

@reata reata added the bug Something isn't working label Sep 30, 2023
@reata
Copy link
Owner

reata commented Dec 26, 2023

This issue is fixed as a result of 6c646a5, where we fixed a separate issue while also optimize the column-from-parenthesis handling.

@reata reata closed this as completed Dec 26, 2023
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