gtoonstra/sqlineage

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

Opened this issue · 0 comments

Hi I have found probably a bug in parsing

I've made a small modification in

zxc a left join bar b on a.x = b.x

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!