Affects Version/s: None
Fix Version/s: None
If joining an expression on the LHS of a join to the first column of the RHS of the join, the join condition is not correctly translated. For instance,
SELECT * FROM emp JOIN dept on emp.deptno + 0 = dept.deptno
JoinRel(condition=[=($9, $9)], joinType=[inner])
but should be
JoinRel(condition=[=($9, $10)], joinType=[inner])
This can occur even if you are apparently just equi-joining columns. If the columns have different types (which might happen if they are from different sources) then even `emp.deptno = dept.deptno` might have an implicit cast.
Problem is in `SqlToRelConverter.pushDownJoinConditions`. A new expression is added to the LHS, and it has the same ID as the expression referencing the RHS.
---------------- Imported from GitHub ----------------
Created by: julianhyde
Created at: Fri Apr 11 00:21:54 CEST 2014