drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arina Ielchiieva (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DRILL-4824) JSON with complex nested data produces incorrect output with missing fields
Date Wed, 03 Aug 2016 10:17:20 GMT

     [ https://issues.apache.org/jira/browse/DRILL-4824?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Arina Ielchiieva updated DRILL-4824:
------------------------------------
    Fix Version/s:     (was: Future)
                   1.9.0
      Description: 
There is incorrect output in case of JSON file with complex nested data. Here is a JSON file:

{code:none|title=example.json|borderStyle=solid}
{
        "Field1" : {
        }
}

{
        "Field1" : {
                "InnerField1": {"key1":"value1"},
                "InnerField2": {"key2":"value2"}
        }
}

{
        "Field1" : {
                "InnerField3" : ["value3", "value4"],
                "InnerField4" : ["value5", "value6"]
        }
}
{code}

Here is actual result after command "select Field1 from dfs.`/tmp/example.json`;":

{code:none}
+---------------------------+
|          Field1           |
+---------------------------+
{"InnerField1":{},"InnerField2":{},"InnerField3":[],"InnerField4":[]}
{"InnerField1":{"key1":"value1"},"InnerField2" {"key2":"value2"},"InnerField3":[],"InnerField4":[]}
{"InnerField1":{},"InnerField2":{},"InnerField3":["value3","value4"],"InnerField4":["value5","value6"]}
+--------------------------+
{code}

I think it is no need to output missing fields. In case of deeply nested structure we will
get unreadable for user result. So my expected result is:

{code:none}
+--------------------------+
|         Field1           |
+--------------------------+
|{}                                                                     
{"InnerField1":{"key1":"value1"},"InnerField2":{"key2":"value2"}}
{"InnerField3":["value3","value4"],"InnerField4":["value5","value6"]}
+--------------------------+
{code}

  was:
There is incorrect output in case of JSON file with complex nested data. Here is a JSON file:

{code:none|title=example.json|borderStyle=solid}
{
        "Field1" : {
        }
}

{
        "Field1" : {
                "InnerField1": {"key1":"value1"},
                "InnerField2": {"key2":"value2"}
        }
}

{
        "Field1" : {
                "InnerField3" : ["value3", "value4"],
                "InnerField4" : ["value5", "value6"]
        }
}
{code}

Here is actual result after command "select Field1 from dfs.`/tmp/example.json`;":

{code:none}
+---------------------------+
|          Field1           |
+---------------------------+
{"InnerField1":{},"InnerField2":{},"InnerField3":[],"InnerField4":[]}
{"InnerField1":{"key1":"value1"},"InnerField2" {"key2":"value2"},"InnerField3":[],"InnerField4":[]}
{"InnerField1":{},"InnerField2":{},"InnerField3":["value3","value4"],"InnerField4":["value5","value6"]}
+--------------------------+
{code}

There is no need to output missing fields. In case of deeply nested structure we will get
unreadable for user result. So my expected result is:

{code:none}
+--------------------------+
|         Field1           |
+--------------------------+
|{}                                                                     
{"InnerField1":{"key1":"value1"},"InnerField2":{"key2":"value2"}}
{"InnerField3":["value3","value4"],"InnerField4":["value5","value6"]}
+--------------------------+
{code}


> JSON with complex nested data produces incorrect output with missing fields
> ---------------------------------------------------------------------------
>
>                 Key: DRILL-4824
>                 URL: https://issues.apache.org/jira/browse/DRILL-4824
>             Project: Apache Drill
>          Issue Type: New Feature
>          Components: Storage - JSON
>    Affects Versions: 1.7.0
>            Reporter: Roman
>            Assignee: Roman
>             Fix For: 1.9.0
>
>
> There is incorrect output in case of JSON file with complex nested data. Here is a JSON
file:
> {code:none|title=example.json|borderStyle=solid}
> {
>         "Field1" : {
>         }
> }
> {
>         "Field1" : {
>                 "InnerField1": {"key1":"value1"},
>                 "InnerField2": {"key2":"value2"}
>         }
> }
> {
>         "Field1" : {
>                 "InnerField3" : ["value3", "value4"],
>                 "InnerField4" : ["value5", "value6"]
>         }
> }
> {code}
> Here is actual result after command "select Field1 from dfs.`/tmp/example.json`;":
> {code:none}
> +---------------------------+
> |          Field1           |
> +---------------------------+
> {"InnerField1":{},"InnerField2":{},"InnerField3":[],"InnerField4":[]}
> {"InnerField1":{"key1":"value1"},"InnerField2" {"key2":"value2"},"InnerField3":[],"InnerField4":[]}
> {"InnerField1":{},"InnerField2":{},"InnerField3":["value3","value4"],"InnerField4":["value5","value6"]}
> +--------------------------+
> {code}
> I think it is no need to output missing fields. In case of deeply nested structure we
will get unreadable for user result. So my expected result is:
> {code:none}
> +--------------------------+
> |         Field1           |
> +--------------------------+
> |{}                                                                     
> {"InnerField1":{"key1":"value1"},"InnerField2":{"key2":"value2"}}
> {"InnerField3":["value3","value4"],"InnerField4":["value5","value6"]}
> +--------------------------+
> {code}



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

Mime
View raw message