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

In LatticeSuggester, allow join conditions that use expressions

    XMLWordPrintableJSON

Details

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

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

            Dates

              Created:
              Updated:
              Resolved: