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

Prevent left NLJoin with non scalar subqueries

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.10.0
    • None
    • None

    Description

      Nested loop join operator in Drill supports only inner join and returns incorrect result for queries with left join and non scalar sub-queries. Drill should throw error in this case.
      Example:

      alter session set planner.enable_nljoin_for_scalar_only=false;
      select t2.dt, t1.fyq, t2.who, t2.event
      from t2
      left join t1 on t2.dt between t1.dts and t1.dte
      order by t2.dt;
      

      Result:

      +-------------+----------+----------+--------------------+
      |     dt      |   fyq    |   who    |       event        |
      +-------------+----------+----------+--------------------+
      | 2016-12-26  | 2016-Q2  | aperson  | had chrsitmas      |
      | 2017-01-06  | 2016-Q3  | aperson  | did somthing       |
      | 2017-01-12  | 2016-Q3  | aperson  | did somthing else  |
      +-------------+----------+----------+--------------------+
      

      Attachments

        1. tmp.tar.gz
          0.8 kB
          Serhii Harnyk

        Issue Links

          Activity

            People

              sharnyk Serhii Harnyk
              sharnyk Serhii Harnyk
              Abhishek Girish Abhishek Girish
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: