hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brock Noland (JIRA)" <>
Subject [jira] [Commented] (HIVE-5865) AvroDeserializer incorrectly assumes keys to Maps will always be of type 'org.apache.avro.util.Utf8'
Date Fri, 03 Oct 2014 16:42:34 GMT


Brock Noland commented on HIVE-5865:

Those tests are failing due to:

I will commit this today. Thanks!!

> AvroDeserializer incorrectly assumes keys to Maps will always be of type 'org.apache.avro.util.Utf8'
> ----------------------------------------------------------------------------------------------------
>                 Key: HIVE-5865
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 0.11.0, 0.12.0, 0.13.0
>            Reporter: Ben Roling
>         Attachments: HIVE-5865-v2.patch, HIVE-5865.2.patch, HIVE-5865.2.patch, HIVE-5865.patch
> AvroDeserializer. deserializeMap() incorrectly assumes the type of they keys will always
be 'org.apache.avro.util.Utf8'.  If the reader schema defines ""="String",
this assumption does not hold, resulting in a ClassCastException.
> I think a simple fix would be to define 'mapDatum' with type Map<CharSequence,Object>
instead of Map<Utf8,Object>.  Assuming the key has the more general type of 'CharSequence'
avoids the need to make an assumption of either String or Utf8.
> I discovered the issue when using Hive 0.11.0.  Looking at the tags it is also there
is in 0.12.0 and trunk:
> The reason I saw this issue was because I pointed my Hive table to a schema file I populated
based on pulling the schema from the SCHEMA$ attribute of an Avro generated Java class and
I used stringType=String in the configuration of the avro-maven-plugin when generating my
Java classes.
> If I alter the schema my Hive table points to such that it doesn't have the ""
attribute on my "map" type objects then queries work fine but if I leave those in there I
get the ClassCastException anytime I try to query the table.

This message was sent by Atlassian JIRA

View raw message