You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Kunal Khatua (JIRA)" <ji...@apache.org> on 2017/03/21 00:58:41 UTC

[jira] [Commented] (DRILL-4578) "children" missing from results of full scan over JSON data

    [ https://issues.apache.org/jira/browse/DRILL-4578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15933912#comment-15933912 ] 

Kunal Khatua commented on DRILL-4578:
-------------------------------------

[~khfaraaz] Please verify and close this with tests added to the framework.

> "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
>            Assignee: Serhii Harnyk
>            Priority: Critical
>             Fix For: 1.10.0
>
>
> 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.15#6346)