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

Rohini Palaniswamy commented on PIG-3608:
-----------------------------------------

 - Can we change "if (isUtf8key && !(key instanceof Utf8))"  to "if (isUtf8key 
&& (key instanceof String))". Previous code was assuming it was always a String 
key. This would be a better check. 
 - Also can we have a pig script as test case instead of just testing the 
method. Because I still don't get in which case the key is being Utf8 when pig 
tries to access the map. Having that test might cover other code paths as well. 
Or are you hitting this error when calling the class standalone outside of pig?

> ClassCastException when looking up a value from AvroMapWrapper using a Utf8 
> key
> -------------------------------------------------------------------------------
>
>                 Key: PIG-3608
>                 URL: https://issues.apache.org/jira/browse/PIG-3608
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.12.0
>            Reporter: Richard Ding
>            Assignee: Richard Ding
>            Priority: Minor
>         Attachments: PIG-3608.patch, PIG-3608_2.patch
>
>
> One got the following exception:
> {code}
> java.lang.ClassCastException: org.apache.avro.util.Utf8 incompatible with 
> java.lang.String 
>     at 
> org.apache.pig.impl.util.avro.AvroMapWrapper.get(AvroMapWrapper.java:80)
> {code}
> This is related to the change by PIG-3420.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to