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

Applying flatten after joining 2 sub-queries returns empty maps

    XMLWordPrintableJSON

Details

    Description

      git.commit.id.abbrev=5cd36c5

      The below query applies flatten after joining 2 subqueries. It generates empty maps which is wrong

      select v1.uid, flatten(events), flatten(transactions) from 
          (select uid, events from `data.json`) v1
      inner join
          (select uid, transactions from `data.json`) v2
      on v1.uid = v2.uid;
      +------------+------------+------------+
      |    uid     |   EXPR$1   |   EXPR$2   |
      +------------+------------+------------+
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 1          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      | 2          | {}         | {}         |
      +------------+------------+------------+
      36 rows selected (0.244 seconds)
      

      I attached the data set. Let me know if you have any questions.

      Attachments

        1. data.json
          4 kB
          Rahul Kumar Challapalli
        2. DRILL-2838.patch
          23 kB
          Jason Altekruse

        Issue Links

          Activity

            People

              jaltekruse Jason Altekruse
              rkins Rahul Kumar Challapalli
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: