Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-340

Optiq IllegalArgumentException when push complex expressions into join conditions.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.9.0-incubating
    • 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.

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            jni Jinfeng Ni
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: