sqllineage icon indicating copy to clipboard operation
sqllineage copied to clipboard

Does column lineage have order (from tableA to tableB)? The order seems to be wrong when subquery-to-subquery

Open codereason opened this issue 1 year ago • 1 comments

In my nested SQL query code it looks like this:

select T.* from ( select tmp.* from ( select RY.* from table RY) tmp ) T

When I'm trying to debug the code and watch the lineages it gets a result like this:

(Column: TMP.*, Column: T.*, Column: RY.*)

Looks like it has lineage from TMP -> T -> RY (all of them's fathers are SubQuery types), where RY is actually on the most inside and T.* on the most outside. Seems RY.*->tmp.*->T.* makes sense to me.

When I was looking up in other posts, it says in a parsed lineage tuple, "the last one is the downstream table/columns, while the rest are upstream(source) table/columns". ( # 元组中最后一个元素为下游表名与字段名,其他元素为上游表名与字段名) Link

Clearly this goes against what I expected. Am I missing some concepts here?

codereason avatar Jun 19 '23 03:06 codereason

This looks like a bug. Can you share the sqllineage version and dialect you're using? Also are you getting the lineage result from command line, or viewing it in UI?

reata avatar Jun 19 '23 13:06 reata

Close as no further response.

reata avatar May 20 '24 04:05 reata