hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pi Song (JIRA)" <j...@apache.org>
Subject [jira] Updated: (PIG-295) The testSortDistinct function in TestEvalPipeline is buggy
Date Fri, 11 Jul 2008 12:18:31 GMT

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

Pi Song updated PIG-295:
------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

Committed.
Thanks Shravan for your good eyes.

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


Mime
View raw message