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

flatten function is dropping the last record when the json file contains even no of records

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • 0.7.0
    • Storage - JSON
    • None

    Description

      git.commit.id.abbrev=5adadfa

      The below query does not produce the right output. It is missing the last record from the data file. The record count is even for the data set. However if it is odd, the flatten operator has not issues .

      0: jdbc:drill:schema=dfs> select rownum, flatten(complex) from `flatten.json`;
      +------------+------------+
      |   rownum   |   EXPR$1   |
      +------------+------------+
      | 1          | {"col1":3} |
      | 1          | {"col2":2,"col3":1} |
      | 1          | {"col1":7} |
      | 2          | {"col2":2,"col3":1} |
      | 2          | {"col1":7} |
      | 3          | {"col1":2,"col3":1} |
      +------------+------------+
      

      Attached the data file. Let me know if you need anything more.

      Attachments

        1. flatten.json
          2 kB
          Rahul Kumar Challapalli

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: