You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Koji Noguchi (JIRA)" <ji...@apache.org> on 2012/10/17 00:55:06 UTC

[jira] [Updated] (PIG-2975) TestTypedMap.testOrderBy failing with incorrect result

     [ https://issues.apache.org/jira/browse/PIG-2975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Koji Noguchi updated PIG-2975:
------------------------------

    Attachment: pig-2975-trunk_v01.txt

bq. I believe the fix would be to store mValue as a BytesArray instead of a Tuple for NullableBytesWritable.java.
Attaching  my idea. I'm only looking at this particular problem without understanding how the overall pig works.  Let me know if this breaks anything.  

Two worries I have so far.
* Can I assume the param to NullableBytesWritable constructor is always DataByteArray ?
* DataByteArray -> NullableBytesWritable -> DataByteArray could cause extra copying that we may not had before.  Added size checking to reduce the number of copies.

This patch does fix the TestTypedMap.testOrderBy output corruption failure we were seeing.  Also, it fixes the bytearray order bug I mentioned in the previous comment.  I'll attach another patch later with the test.
                
> TestTypedMap.testOrderBy failing with incorrect result 
> -------------------------------------------------------
>
>                 Key: PIG-2975
>                 URL: https://issues.apache.org/jira/browse/PIG-2975
>             Project: Pig
>          Issue Type: Sub-task
>    Affects Versions: 0.11
>            Reporter: Koji Noguchi
>            Assignee: Koji Noguchi
>            Priority: Blocker
>             Fix For: 0.11
>
>         Attachments: pig-2975-trunk_v01.txt
>
>
> Looked at 
> {noformat}
> junit.framework.AssertionFailedError
>     at org.apache.pig.test.TestTypedMap.testOrderBy(TestTypedMap.java:352)
> {noformat}
> This looks like a valid test case failing with incorrect result.
> {noformat}
> % cat test/orderby.txt
> [key#1,key9#23]
> [key#3,key3#2]
> [key#22]
> % cat test/orderby.pig
> a = load 'test/orderby.txt' as (m:[]);
> b = foreach a generate m#'key' as b0;
> dump b;
> c = order b by b0;
> dump c;
> % java ... org.apache.pig.Main    -x local test/orderby.pig 
> [dump b]
> (1)
> (3)
> (22)
> ...
> [dump c]
> (1)
> (1)
> (22)
> %
> where did the '(3)' go?
> {noformat}

--
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: http://www.atlassian.com/software/jira