You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a SQL statement ends with multiple semicolons, it will be split to several statements with all of them other than the first one contain a semicolon only. And those semicolon only statement triggers InvalidSyntaxException
SQL
Paste the SQL text here. For example:
SELECT*FROM DUAL;;
To Reproduce
sqllineage -f test.sql --dialect=ansi
Traceback (most recent call last):
File "/home/hujunwei/.pyenv/versions/3.12.0/bin/sqllineage", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/hujunwei/.pyenv/versions/3.12.0/lib/python3.12/site-packages/sqllineage/cli.py", line 109, in main
runner.print_table_lineage()
File "/home/hujunwei/.pyenv/versions/3.12.0/lib/python3.12/site-packages/sqllineage/runner.py", line 176, in print_table_lineage
print(str(self))
^^^^^^^^^
File "/home/hujunwei/.pyenv/versions/3.12.0/lib/python3.12/site-packages/sqllineage/runner.py", line 26, in wrapper
self._eval()
File "/home/hujunwei/.pyenv/versions/3.12.0/lib/python3.12/site-packages/sqllineage/runner.py", line 193, in _eval
self._stmt_holders = [analyzer.analyze(stmt) for stmt in self._stmt]
^^^^^^^^^^^^^^^^^^^^^^
File "/home/hujunwei/.pyenv/versions/3.12.0/lib/python3.12/site-packages/sqllineage/core/parser/sqlfluff/analyzer.py", line 42, in analyze
statement_segments = self._list_specific_statement_segment(sql)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hujunwei/.pyenv/versions/3.12.0/lib/python3.12/site-packages/sqllineage/core/parser/sqlfluff/analyzer.py", line 73, in _list_specific_statement_segment
raise InvalidSyntaxException(
sqllineage.exceptions.InvalidSyntaxException: This SQL statement is unparsable, please check potential syntax error for SQL:
;
Line 1, Position 1: Found unparsable section: ';'
Expected behavior
No exception thrown.
Python version (available via python --version)
3.12.0
SQLLineage version (available via sqllineage --version):
1.4.9
The text was updated successfully, but these errors were encountered:
Describe the bug
When a SQL statement ends with multiple semicolons, it will be split to several statements with all of them other than the first one contain a semicolon only. And those semicolon only statement triggers InvalidSyntaxException
SQL
Paste the SQL text here. For example:
To Reproduce
Expected behavior
No exception thrown.
Python version (available via
python --version
)SQLLineage version (available via
sqllineage --version
):The text was updated successfully, but these errors were encountered: