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
Relations are wrong when using intermediate tables on column level. When using a intermediate table and naming its columns, it is describing the columns as the Table/Subquery instead of the table name specified.
SQL
insert intodb_test.table_targetselect col_1_renamed, col_2_renamed from
(Select col1, max(col2) fromdb_test.table_srcwhere
col1 ="AV"and
col2 is not null
) AS Inter_table(col_1_renamed, col_2_renamed);
To Reproduce
fromsqllineage.runnerimportLineageRunner, LineageLevelquery=""" insert into db_test.table_targetselect col_1_renamed, col_2_renamed from(Select col1, max(col2) from db_test.table_srcwhere col1 = "AV" and col2 is not null) AS Inter_table(col_1_renamed, col_2_renamed);"""result= (
LineageRunner(query, dialect="teradata")
)
lineage_stmt=result.to_cytoscape(LineageLevel.COLUMN)
print(lineage_stmt)
Expected behavior
The code should detect Inter_table as the Subquery and not (col_1_renamed, col_2_renamed) as a whole. The column lineage as source and target should be:
db_test.table_src.col1 -> Inter_table.col_1_renamed
db_test.table_src.col2 -> Inter_table.col_2_renamed
Describe the bug
Relations are wrong when using intermediate tables on column level. When using a intermediate table and naming its columns, it is describing the columns as the Table/Subquery instead of the table name specified.
SQL
To Reproduce
Expected behavior
The code should detect Inter_table as the Subquery and not (col_1_renamed, col_2_renamed) as a whole. The column lineage as source and target should be:
db_test.table_src.col1 -> Inter_table.col_1_renamed
db_test.table_src.col2 -> Inter_table.col_2_renamed
Inter_table.col_1_renamed -> db_test.table_target.col_1_renamed
Inter_table.col_2_renamed -> db_test.table_target.col_2_renamed
**Python version
SQLLineage version (available via
sqllineage --version
):Additional context
Looks like there is a problem when detecting intermediate tables
The text was updated successfully, but these errors were encountered: