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

Shravan Matthur Narayanamurthy updated PIG-295:
-----------------------------------------------

    Attachment: testSort.patch

> The testSortDistinct function in TestEvalPipeline is buggy
> ----------------------------------------------------------
>
>                 Key: PIG-295
>                 URL: https://issues.apache.org/jira/browse/PIG-295
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: types_branch, 0.0.0
>            Reporter: Shravan Matthur Narayanamurthy
>            Assignee: Shravan Matthur Narayanamurthy
>            Priority: Minor
>             Fix For: types_branch
>
>         Attachments: testSort.patch
>
>
> The problem is that last is supposed to be holding the last read value from 
> the tuple but clearly it does not right now as can be seen below:
>               int last = -1;
>               while (iter.hasNext()){
>                       Tuple t = iter.next();
>                       if (eliminateDuplicates){
>                               assertTrue(last < 
> t.getAtomField(0).numval().intValue());
>                       }else{
>                               assertTrue(last <= 
> t.getAtomField(0).numval().intValue());
>                               assertEquals(t.arity(), 2);
>                       }
>               }
> last is always -1 & all tests pass. This should be correct aptly for the 
> non-types branch if we want to. But the fix I am attaching is just for the 
> types branch. Here since we do not have types, there will be bytearray 
> comparison leading to lexicographic sorting. So changed the tests to test 
> that rather than numeric sorting.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to