Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.1.0
-
None
-
None
Description
I ran into the following case, where a query fails to parse if the join order is changed:
create database if not exists test; drop table if exists test.table1; create table test.table1 ( id string, col_a string ) stored as textfile; drop table if exists test.table2; create table test.table2 ( id string ) stored as textfile; drop table if exists test.table3; create table test.table3 ( col_a string, col_b string ) stored as textfile; drop table if exists test.table4; create table test.table4 ( id string ) stored as textfile; -- This fails with: Invalid table alias or column reference 't3': (possible column names are: id, col_a) select 1 from test.table1 as t1 left join test.table2 as t2 on t2.id = t1.id left join test.table3 as t3 on t1.col_a = t3.col_a left join test.table4 as t4 on t1.id = t4.id and t3.col_b = 'X' ; -- This works select 1 from test.table1 as t1 left join test.table3 as t3 on t1.col_a = t3.col_a left join test.table4 as t4 on t1.id = t4.id and t3.col_b = 'X' left join test.table2 as t2 on t2.id = t1.id ;