[jira] [Commented] (PIG-3608) ClassCastException when looking up a value from AvroMapWrapper using a Utf8 key

2013-12-29 Thread Richard Ding (JIRA)

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

Richard Ding commented on PIG-3608:
---

Thanks [~cheolsoo].

> 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
> Fix For: 0.13.0
>
> 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.5#6160)


[jira] [Commented] (PIG-3608) ClassCastException when looking up a value from AvroMapWrapper using a Utf8 key

2013-12-28 Thread Cheolsoo Park (JIRA)

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

Cheolsoo Park commented on PIG-3608:


CHANGES.txt was not updated at the commit. I fixed it.

> 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
> Fix For: 0.13.0
>
> 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.5#6160)


[jira] [Commented] (PIG-3608) ClassCastException when looking up a value from AvroMapWrapper using a Utf8 key

2013-12-26 Thread Rohini Palaniswamy (JIRA)

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

Rohini Palaniswamy commented on PIG-3608:
-

+1

> 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.5#6160)


[jira] [Commented] (PIG-3608) ClassCastException when looking up a value from AvroMapWrapper using a Utf8 key

2013-12-23 Thread Richard Ding (JIRA)

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

Richard Ding commented on PIG-3608:
---

Thanks for reviewing the patch.

Right now I don't have a Pig script to demonstrate this use case. I'm getting 
this problem while trying to iterate an instance of AvroMapWrapper and find out 
that I can't look up the value from the map using the key just retrieved from 
the map. I think this breaks the basic contract of a map implementation.

I think the check

{code}
if (isUtf8key && !(key instanceof Utf8))
{code}

is more general. But I'm ok if it is restricted to String.


> 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.5#6160)


[jira] [Commented] (PIG-3608) ClassCastException when looking up a value from AvroMapWrapper using a Utf8 key

2013-12-06 Thread Rohini Palaniswamy (JIRA)

[ 
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)


[jira] [Commented] (PIG-3608) ClassCastException when looking up a value from AvroMapWrapper using a Utf8 key

2013-12-05 Thread Rohini Palaniswamy (JIRA)

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

Rohini Palaniswamy commented on PIG-3608:
-

With the testcase in PIG-3420, the key in AvroMapper was utf8 (i.e 
isUtf8key=true), but the pig map had the key passed as String.  I don't know in 
what case you are getting ClassCastException. The full stack trace and pig 
script would help to know what is happening.

> 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
>
>
> 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)


[jira] [Commented] (PIG-3608) ClassCastException when looking up a value from AvroMapWrapper using a Utf8 key

2013-12-05 Thread Richard Ding (JIRA)

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

Richard Ding commented on PIG-3608:
---

Actually I have a question: should it be

{code}
if (isUtf8key) {
  v = innerMap.get(key);
} else {
  v = innerMap.get(new Utf8((String) key));
}
{code}

since isUft8key == true means the key is already Utf8?

> 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
>
>
> 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)


[jira] [Commented] (PIG-3608) ClassCastException when looking up a value from AvroMapWrapper using a Utf8 key

2013-12-05 Thread Rohini Palaniswamy (JIRA)

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

Rohini Palaniswamy commented on PIG-3608:
-

Code looks good. Can we just have a unit testcase added or modified to have 
this case so that some other change does not break it?

> 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
>
>
> 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)