Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Optiq SqlToRelConverter will throw IllegalArgumentException, when join conditions in the on clause contains a complex expression, in stead of a single column. For example ( the query itself is not a meaningful one).
select e."deptno", d."deptno"
from "hr"."emps" as e
join "hr"."depts" as d
on ( e."deptno" + 1 - 1 = d."deptno" + 2 - 2 and
e."deptno" + 10 - 10 = d."deptno" + 20 - 20 )
Optiq is trying to create projects for complex expression on both sides of join operator, and push project past the join operator.
Join (#1 = # 4 and #2 = #5)
/ \
Proj ( deptno, deptno+1-1, deptno +10-10) Proj ( deptno, deptno+2-1, deptno +20-20)
However, in SqlRelConverter:pushDownJoinConditions(), the index for the new created expressions are not maintained properly, which lead to the IllegalArgumentException.