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

Empty Json file can potentially result into wrong results

    XMLWordPrintableJSON

Details

    Description

      In the directory, we have two files. One has some data and the other one is empty. A query as below:

      select * from dfs.`directory`;
      

      will produce different results according to the order of the files being read (The default order is in the alphabetic order of the filenames). To give a more concrete example, the non-empty json has data:

      {
            a:1
      }
      

      By naming the files, you can control the orders. If the empty file is read in firstly, the result is

      +-------+----+
      |   *   | a  |
      +-------+----+
      | null  | 1  |
      +-------+----+
      

      If the opposite order takes place, the result is

      +----+
      | a  |
      +----+
      | 1  |
      | 2  |
      +----+
      

      Attachments

        Activity

          People

            cchang@maprtech.com Chun Chang
            seanhychu Sean Hsuan-Yi Chu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: