You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Sean Hsuan-Yi Chu (JIRA)" <ji...@apache.org> on 2015/07/22 01:49:05 UTC

[jira] [Created] (DRILL-3537) Empty Json file can potentially result into wrong results

Sean Hsuan-Yi Chu created DRILL-3537:
----------------------------------------

             Summary: Empty Json file can potentially result into wrong results 
                 Key: DRILL-3537
                 URL: https://issues.apache.org/jira/browse/DRILL-3537
             Project: Apache Drill
          Issue Type: Bug
          Components: Execution - Relational Operators, Storage - JSON
            Reporter: Sean Hsuan-Yi Chu
            Assignee: Sean Hsuan-Yi Chu
            Priority: Critical


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

{code}
select * from dfs.`directory`;
{code}

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:

{code}
{
      a:1
}
{code}

By naming the files, you can control the orders. If the empty file is read in firstly, the result is
{code}
+-------+----+
|   *   | a  |
+-------+----+
| null  | 1  |
+-------+----+
{code}

If the opposite order takes place, the result is
{code}
+----+
| a  |
+----+
| 1  |
| 2  |
+----+
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)