Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-7050

RexNode convert exception in subquery

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.14.0, 1.15.0
    • Fix Version/s: 1.17.0
    • Component/s: None
    • Labels:

      Description

      If the query contains a subquery whose filters are associated with the main query, an error occurs: PLAN ERROR: Cannot convert RexNode to equivalent Drill expression. RexNode Class: org.apache.calcite.rex.RexCorrelVariable

      Steps to reproduce:
      1) Create source table (or view, doesn't matter)

      create table dfs.root.source as  (
          select 1 as id union all select 2 as id
      )
      

      2) Execute query

      select t1.id,
      	(select count(t2.id) 
      	from dfs.root.source t2 where t2.id = t1.id)
      from  dfs.root.source t1
      

      Reason:

      Method

      org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.lookupExp

      call

      RexBuilder.makeCorrel

      in some cases

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                volodymyr Vova Vysotskyi
                Reporter:
                le.louch Oleg Zinoviev
                Reviewer:
                Arina Ielchiieva
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: