hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashutosh Chauhan (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-7036) get_json_object bug when extract list of list with index
Date Mon, 12 May 2014 20:54:15 GMT

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

Ashutosh Chauhan updated HIVE-7036:
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.14.0
           Status: Resolved  (was: Patch Available)

Committed to trunk. Thanks, Navis!

> get_json_object bug when extract list of list with index
> --------------------------------------------------------
>
>                 Key: HIVE-7036
>                 URL: https://issues.apache.org/jira/browse/HIVE-7036
>             Project: Hive
>          Issue Type: New Feature
>          Components: UDF
>    Affects Versions: 0.12.0, 0.13.0
>         Environment: all
>            Reporter: Ming Ma
>            Assignee: Navis
>            Priority: Minor
>              Labels: udf
>             Fix For: 0.14.0
>
>         Attachments: HIVE-7036.1.patch.txt
>
>
> https://github.com/apache/hive/blob/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFJson.java#L250
> this line should be out of the for-loop
> For example 
> json = '{"h":[1, [2, 3], {"i": 0}, [{"p": 11}, {"p": 12}, {"pp": 13}]}'
> get_json_object(json, '$.h[*][0]') should return back the first node(if exists) of every
childrenof '$.h'
> which specifically should be 
> [2,{"p":11}] 
> but hive returns only
> 2
> because when hive pick the node '2' out, the tmp_jsonList will change to a list only
contains one node '2':
> [2]
> then it was assigned to variable jsonList, in the next loop, value of i would be 2 which
is greater than the size(always 1) of jsonList, then the loop broke out.



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

Mime
View raw message