Below is a simplified example, our production scenarios are more complicated but it boils down to this.
SQL
CREATE TABLE MAIN.FOOBAR AS (
WITH FOO AS (
SELECT COL1, COL2 FROM FROM MAIN.BAR
)
SELECT * FROM FOO
)
Column Lineage fails to resolve columns defined in FOO
To Reproduce
from sqllineage.runner import LineageRunner
sql1 = """
CREATE TABLE MAIN.FOOBAR AS (
WITH FOO AS (
SELECT COL1, COL2 FROM FROM MAIN.BAR
)
SELECT * FROM FOO
)
"""
LineageRunner(sql1).print_column_lineage()
Describe the bug Column lineage fails to resolve when referencing a SELECT * from a CTE.
Not sure if this is the same issue as https://github.com/reata/sqllineage/issues/303 as it looks similar just 1 layer deeper with a secondary select * CTE.
Below is a simplified example, our production scenarios are more complicated but it boils down to this.
SQL
Column Lineage fails to resolve columns defined in FOO
To Reproduce
actual output is
I'd expect it to return this instead
Python version (available via
python --version
)SQLLineage version (available via
sqllineage --version
):We noticed the issue using the snowflake dialect for our own production use cases