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
The SQL statement below is valid for Exasol and produces the desired results when used in production (in a more complex scenario).
However, sqllineage throws an error when processing the file.
I think this is because COL_A appears in multiple CTEs and the correct base table can not be determined when LOCAL is used as well, maybe because of a wrong evaluation order.
Interestingly, the error is not thrown if there are no parenthesis in the last line, e.g. LOCAL.COL_A - LOCAL.COL_B AS COL_C works fine. Also, using other dialects like ansi work as well. However, this is not a possible workaround in our scenario.
SQL
INSERT INTO TABLE_A
(COL_A,
COL_B,
COL_C)
WITH CTE1 AS (SELECT COL_A, ID FROM TABLE_B WHERE COND_A),
CTE2 AS (SELECT COL_A, ID FROM TABLE_C WHERE COND_B),
SELECTCTE1.COL_AAS COL_A,
CTE2.COL_AAS COL_B,
(LOCAL.COL_A-LOCAL.COL_B) /5AS COL_C
FROM CTE1
LEFT JOIN CTE2 ONCTE1.ID=CTE2.ID;
To Reproduce
if CLI (Command Line Interface): provide the command you're calling and the output.
For example:
sqllineage -f test.sql --dialect=exasol
File "/home/vscode/venv/bin/sqllineage", line 8, in <module>
sys.exit(main())
File "/home/vscode/venv/lib/python3.10/site-packages/sqllineage/cli.py", line 109, in main
runner.print_table_lineage()
File "/home/vscode/venv/lib/python3.10/site-packages/sqllineage/runner.py", line 176, in print_table_lineage
print(str(self))
File "/home/vscode/venv/lib/python3.10/site-packages/sqllineage/runner.py", line 26, in wrapper
self._eval()
File "/home/vscode/venv/lib/python3.10/site-packages/sqllineage/runner.py", line 194, in _eval
self._sql_holder = SQLLineageHolder.of(
File "/home/vscode/venv/lib/python3.10/site-packages/sqllineage/core/holders.py", line 349, in of
g = SQLLineageHolder._build_digraph(metadata_provider, *args)
File "/home/vscode/venv/lib/python3.10/site-packages/sqllineage/core/holders.py", line 330, in _build_digraph
raise InvalidSyntaxException(
sqllineage.exceptions.InvalidSyntaxException: col_a is not allowed from more than one table or subquery
Expected behavior
The SQL should be processed correctly, the output should identical to the working case of using --dialect=ansi.
The result should be:
Describe the bug
The SQL statement below is valid for Exasol and produces the desired results when used in production (in a more complex scenario).
However, sqllineage throws an error when processing the file.
I think this is because
COL_A
appears in multiple CTEs and the correct base table can not be determined when LOCAL is used as well, maybe because of a wrong evaluation order.Interestingly, the error is not thrown if there are no parenthesis in the last line, e.g.
LOCAL.COL_A - LOCAL.COL_B AS COL_C
works fine. Also, using other dialects like ansi work as well. However, this is not a possible workaround in our scenario.SQL
To Reproduce
if
CLI (Command Line Interface): provide the command you're calling and the output.For example:
Expected behavior
The SQL should be processed correctly, the output should identical to the working case of using --dialect=ansi.
The result should be:
Statements(#): 1
Source Tables:
.cte1
.cte2
.table_b
.table_c
Target Tables:
.table_a
Python version (available via
python --version
)3.10.12
SQLLineage version (available via
sqllineage --version
):1.4.9
Additional context
Dialect: Exasol
The text was updated successfully, but these errors were encountered: