jinqi long created HIVE-29616:
---------------------------------
Summary: Incorrect column lineage when multiple subqueries with
identical table aliases
Key: HIVE-29616
URL: https://issues.apache.org/jira/browse/HIVE-29616
Project: Hive
Issue Type: Bug
Components: lineage
Affects Versions: 1.1.0
Reporter: jinqi long
Fix For: 4.3.0
The logic in ExprProcFactory#findSourceColumn resolves source columns from
TopOps by matching table and field aliases. If a match is found, it returns
the result directly. This implementation fails in scenarios involving multiple
subqueries with identical table aliases (e.g., in a UNION statement). Because
the search returns the first match it encounters, it may link to the wrong
source column from a different subquery branch, leading to incorrect lineage.
for example:
{code:java}
create table table_3 as
select id1 from table_1 t1 where t1.id2 = 1
union all
select id1 from table_2 t1 where t1.id2 = 2;{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)