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

In LatticeSuggester, allow join conditions that use expressions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.22.0
    • Component/s: None
    • Labels:
      None

      Description

      In LatticeSuggester, allow join conditions that use expressions. For example, the query

      select *
      from emp
      join dept on emp.deptno + 1 = dept.deptno
      

      uses an expression "emp.deptno + 1" on the "emp" side of the join key.

      Currently this query throws:

      java.lang.ClassCastException: class org.apache.calcite.materialize.LatticeSuggester$DerivedColRef cannot be cast to class org.apache.calcite.materialize.LatticeSuggester$BaseColRef
      	at org.apache.calcite.materialize.LatticeSuggester.frame(LatticeSuggester.java:478)
      	at org.apache.calcite.materialize.LatticeSuggester.frame(LatticeSuggester.java:420)
      	at org.apache.calcite.materialize.LatticeSuggester.frame(LatticeSuggester.java:399)
      	at org.apache.calcite.materialize.LatticeSuggester.addQuery(LatticeSuggester.java:124)
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: