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

Projecting '*' returns all nulls when we have flatten in a filter and order by

    XMLWordPrintableJSON

Details

    Description

      git.commit.id.abbrev=3d863b5

      The below query returns all nulls currently :

      0: jdbc:drill:schema=dfs_eea> select * from `data.json` where 2 in (select flatten(lst_lst[1]) from `data.json`) order by flatten(lst_lst[1]);
      +------------+
      |     *      |
      +------------+
      | null       |
      | null       |
      | null       |
      | null       |
      | null       |
      | null       |
      | null       |
      | null       |
      | null       |
      | null       |
      +------------+
      

      There seems to be another issue here since the no of records returned also does not look right. I will raise a separate JIRA for that.

      The issue goes away, if we do an order by without the flatten. Below query works

      select * from `data.json` where 2 in (select flatten(lst_lst[1]) from `data.json`) order by uid;
      

      Attached the data files

      Attachments

        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:
                Resolved: