hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chaoyu Tang (JIRA)" <>
Subject [jira] [Commented] (HIVE-5320) Querying a table with nested struct type over JSON data results in errors
Date Thu, 19 Sep 2013 14:12:53 GMT


Chaoyu Tang commented on HIVE-5320:

Please review the attached patch for the fix.
> Querying a table with nested struct type over JSON data results in errors
> -------------------------------------------------------------------------
>                 Key: HIVE-5320
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>          Components: Serializers/Deserializers
>    Affects Versions: 0.9.0
>            Reporter: Chaoyu Tang
>            Assignee: Chaoyu Tang
>         Attachments: HIVE-5320.patch
> Querying a table with nested_struct datatype like
> ==
> create table nest_struct_tbl (col1 string, col2 array<struct<a1:string, a2:array<struct<b1:int,
b2:string, b3:string>>>>) ROW FORMAT SERDE '';

> ==
> over JSON data cause errors including java.lang.IndexOutOfBoundsException or corrupted
> The JsonSerDe used is json-serde-1.1.4.jar/json-serde-1.1.4-jar-dependencies.jar.
> The cause is that the method:
> public List<Object> getStructFieldsDataAsList(Object o) 
> in 
> returns a list referencing to a static arraylist "values"
> So the local variable 'list' in method serialize of Hive LazySimpleSerDe class is returned
with same reference in its recursive calls and its element values are kept on being overwritten
in the case STRUCT.
> Solutions:
> 1. Fix in JsonSerDe, and change the field 'values' in
> to instance scope.
> Filed a ticket to JSonSerDe (
> 2. Ideally, in the method serialize of class LazySimpleSerDe, we should defensively save
a copy of a list resulted from list = soi.getStructFieldsDataAsList(obj) in which case the
soi is the instance of JsonStructObjectInspector, so that the recursive calls of serialize
can work properly regardless of the extended SerDe implementation.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message