You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Aditya Kishore (JIRA)" <ji...@apache.org> on 2014/07/29 05:38:38 UTC

[jira] [Commented] (DRILL-1195) Querying nested array elements in Json returns only null values

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

Aditya Kishore commented on DRILL-1195:
---------------------------------------

The attached patch fixes the issue and contains a test case which add on level deeper access to an array member.

{code}
Data:
{"rownum":1, "a":{"arrayval": [ {"val1":["a1"]}, {"val2":"[a2]"}, {"val3":"[a3]"} ]}}
{"rownum":2, "a":{"arrayval": [ {"val1":["b1"]}, {"val2":"[b2]"}, {"val3":"[b3]"} ]}}
{"rownum":3, "a":{"arrayval": [ {"val1":["c1"]}, {"val2":"[c2]"}, {"val3":"[c3]"} ]}}
{"rownum":4, "a":{"arrayval": [ {"val1":["d1"]}, {"val2":"[d2]"}, {"val3":"[d3]"} ]}}
{"rownum":5, "a":{"arrayval": [ {"val1":["e1"]}, {"val2":"[e2]"}, {"val3":"[e3]"} ]}}

Query:
select tbl.a.arrayval[0].val1[0] from cp.`nested/nested_3.json` tbl

Result:
EXPR$0
a1
b1
c1
d1
e1
Total rows returned : 5
{code}


> Querying nested array elements in Json returns only null values
> ---------------------------------------------------------------
>
>                 Key: DRILL-1195
>                 URL: https://issues.apache.org/jira/browse/DRILL-1195
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Data Types
>    Affects Versions: 0.4.0
>            Reporter: Amit Katti
>            Assignee: DrillCommitter
>             Fix For: 0.4.0
>
>         Attachments: DRILL-1195-Querying-nested-array-elements-in-JSON-re.patch
>
>
> Incorrect result are returned while querying nested array elements (see comment below for illustrated examples).



--
This message was sent by Atlassian JIRA
(v6.2#6252)