Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
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 | +----+