sqlineage icon indicating copy to clipboard operation
sqlineage copied to clipboard

Parsing doesn't work if there is subselect in FROM and JOIN

Open jhettler opened this issue 7 years ago • 0 comments

Hi I have found probably a bug in parsing

I've made a small modification in https://github.com/gtoonstra/sqlineage/blob/c3cce0abf8f56b1450da44088714699e0633bb18/tests/resources/joins/join_with_select_in_join.sql#L5

zxc --> (select * from zxc)

insert into foo( a, b, c, d )
select
a.d, a.e, b.f, c.z
from 
    (select * from zxc) a left join bar b on a.x = b.x
    inner join (select f.p from ghi f where f.y = a.y) c on b.y = c.y
where
    b.t = '2'
union
select
q.d, q.e, d.f, e.z
from
    def q inner join xyz d on q.x = d.x
    left join (select f.p from ghi f where f.y = c.y) e on d.y = e.y
where 
    q.s = d.s

and if you run sqlineage with the SQL above, there is no table zxc in result

parent:ROOT table:ROOT joins: NONE 0 parent:ROOT table:foo joins: INSERT 1 parent:ROOT table: joins:bar|b SELECT 1 parent: table:ghi joins: SELECT 2 parent:ROOT table:def joins:xyz|d SELECT 1 parent:q table:ghi joins: SELECT 2

Could you please somehow help me to fix this?

Thank you very much!

jhettler avatar Sep 25 '18 13:09 jhettler