Khurram Faraaz created DRILL-4578:
-------------------------------------

             Summary: "children" missing from results of full scan over JSON 
data
                 Key: DRILL-4578
                 URL: https://issues.apache.org/jira/browse/DRILL-4578
             Project: Apache Drill
          Issue Type: Bug
          Components: Storage - JSON
         Environment: 4 node cluster CentOS
            Reporter: Khurram Faraaz


One of the fields named "children" is missing from the output of SELECT * over 
the JSON data, with or without enabling all_text_mode for JSON data.
Projecting just the "children" field returns a null.
Note that children field holds an empty array.

 Drill 1.7.0-SNAPSHOT  commit ID e7e9b73c

{noformat}
0: jdbc:drill:schema=dfs.tmp> alter session set `store.json.all_text_mode`=true;
+-------+------------------------------------+
|  ok   |              summary               |
+-------+------------------------------------+
| true  | store.json.all_text_mode updated.  |
+-------+------------------------------------+
1 row selected (0.118 seconds)
0: jdbc:drill:schema=dfs.tmp> select * from `employee.json`;
+------------+-----------+----------+------+------------+---------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------------------------------------------+
| firstName  | lastName  | isAlive  | age  | height_cm  |                       
                    address                                           |         
                            phoneNumbers                                     |  
                          hobbies                            |
+------------+-----------+----------+------+------------+---------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------------------------------------------+
| John       | Smith     | true     | 45   | 177.6      | {"streetAddress":"29 
4th Street","city":"New York","state":"NY","postalCode":"10021-3100"}  | 
[{"type":"home","number":"212 555-1234"},{"type":"office","number":"646 
555-4567"}]  | ["scuba diving","hiking","biking","rock climbing","surfing"]  |
+------------+-----------+----------+------+------------+---------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------------------------------------------+
1 row selected (0.214 seconds)
0: jdbc:drill:schema=dfs.tmp> select t.children from `employee.json` t;
+-----------+
| children  |
+-----------+
| null      |
+-----------+
1 row selected (0.148 seconds)
{noformat}

JSON data used in test

{noformat}
[root@centos-01 ~]# cat employee.json
{
  "firstName": "John",
  "lastName": "Smith",
  "isAlive": true,
  "age": 45,
  "height_cm": 177.6,
  "address": {
    "streetAddress": "29 4th Street",
    "city": "New York",
    "state": "NY",
    "postalCode": "10021-3100"
  },
  "phoneNumbers": [
    {
      "type": "home",
      "number": "212 555-1234"
    },
    {
      "type": "office",
      "number": "646 555-4567"
    }
  ],
  "children": [],
  "hobbies": ["scuba diving","hiking","biking","rock climbing","surfing"]
}
{noformat}



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

Reply via email to