hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brock Noland (JIRA)" <>
Subject [jira] [Commented] (HIVE-5320) Querying a table with nested struct type over JSON data results in errors
Date Fri, 20 Sep 2013 21:04:53 GMT


Brock Noland commented on HIVE-5320:

I agree that is the long term solution, but until we can pull in the next release, it makes
sense to commit a work around, no? Along with a JIRA to track the real fix. Is it possible
to get the OI's name at that point and only do the copy if we are working with the bad IO?
> 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