You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Shravan Matthur Narayanamurthy (JIRA)" <ji...@apache.org> on 2008/07/07 20:24:31 UTC

[jira] Created: (PIG-295) The testSortDistinct function in TestEvalPipeline is buggy

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: 0.0.0, types_branch
            Reporter: Shravan Matthur Narayanamurthy
            Assignee: Shravan Matthur Narayanamurthy
            Priority: Minor
             Fix For: types_branch


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.


[jira] Updated: (PIG-295) The testSortDistinct function in TestEvalPipeline is buggy

Posted by "Shravan Matthur Narayanamurthy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Status: Patch Available  (was: Open)

The fix I am attaching is just for the types branch. Here since the test is not typed, there will be bytearray comparison leading to lexicographic sorting. So changed the tests to test that rather than numeric sorting.

> 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: 0.0.0, types_branch
>            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.


[jira] Updated: (PIG-295) The testSortDistinct function in TestEvalPipeline is buggy

Posted by "Pi Song (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Updated: (PIG-295) The testSortDistinct function in TestEvalPipeline is buggy

Posted by "Shravan Matthur Narayanamurthy (JIRA)" <ji...@apache.org>.
     [ 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.