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

Missing target table with tsql parsing into statements with union #562

Closed
Guojcc opened this issue Jan 19, 2024 · 6 comments · Fixed by #572
Closed

Missing target table with tsql parsing into statements with union #562

Guojcc opened this issue Jan 19, 2024 · 6 comments · Fixed by #572
Labels
bug Something isn't working

Comments

@Guojcc
Copy link

Guojcc commented Jan 19, 2024

Describe the bug

  • There is an issue with tsql parsing into statements with union, unable to obtain target

SQL

select * into t3 from t1 union all select * from t2
  • if CLI (Command Line Interface): provide the command you're calling and the output.
    For example:
sqllineage -e 'select * into t3 from t1 union all select * from t2' -d tsql
Statements(#): 1
Source Tables:
    <default>.t2
    <default>.t3
Target Tables:

Python version (available via python --version)

  • 3.12.1

SQLLineage version (available via sqllineage --version):

  • 1.5.0
@Guojcc Guojcc added the bug Something isn't working label Jan 19, 2024
@reata
Copy link
Owner

reata commented Jan 20, 2024

The expected output should be:

Source Tables:
    <default>.t1
    <default>.t2
Target Tables:
    <default>.t3

Is that correct?

@Guojcc
Copy link
Author

Guojcc commented Jan 22, 2024

Yes, this is correct

@reata
Copy link
Owner

reata commented Jan 29, 2024

Thanks for your confirmation. Looks like we have some issue in handling SELECT INTO + UNION case.

@Guojcc
Copy link
Author

Guojcc commented Jan 30, 2024

麻烦帮忙修复嘛,这对我真的很重要 0.0。
可以在这里请教一个问题嘛,对于SQL server存储过程的解析,我使用时,不能直接解析,需要去掉create ... begin ... 之后,只保留sql,才可以。怎样可以直接解析,或者忽略掉 create ..... begin ... 语句,silent_mode = True,添加了,也无法解析.....

@maoxingda
Copy link
Contributor

You need to do preprocessing yourself, because sqlfluff does not support stored procedures, not sqllineage.

@Guojcc
Copy link
Author

Guojcc commented Jan 30, 2024

ok

@reata reata changed the title There is an issue with tsql parsing into statements with union Missing target table with tsql parsing into statements with union Jan 31, 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

Successfully merging a pull request may close this issue.

3 participants