Issue Details (XML | Word | Printable)

Key: HADOOP-4545
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Owen O'Malley
Reporter: Owen O'Malley
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

Add an example of a secondary sort

Created: 30/Oct/08 05:19 AM   Updated: 08/Jul/09 05:06 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 0.20.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works h4545.patch 2008-12-16 06:10 AM Owen O'Malley 14 kB
Text File Licensed for inclusion in ASF works h4545.patch 2008-10-30 05:24 AM Owen O'Malley 10 kB

Hadoop Flags: Reviewed
Resolution Date: 16/Dec/08 05:00 PM


 Description  « Hide
We should have an example of using secondary sort.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Owen O'Malley added a comment - 30/Oct/08 05:24 AM
Here is an example.

Chris Douglas added a comment - 30/Oct/08 06:53 AM
Looks good. A unit test using this example would also be helpful; there aren't many tests that use the grouping comparator.

Owen O'Malley added a comment - 16/Dec/08 06:10 AM
This patch:
1. Updates the example to the new map/reduce api
2. Adds a unit test case.

Chris Douglas added a comment - 16/Dec/08 10:30 AM
+1

Owen O'Malley added a comment - 16/Dec/08 05:00 PM
I just committed this.

Hudson added a comment - 22/Dec/08 03:15 PM

Rares Vernica added a comment - 13/Jun/09 04:46 AM - edited
In the example, is there a typo in the hashCode function of IntPair?
    public int hashCode() {
      return first * 157 + second;
                     ^^^
                     127?
    }

Here is the .java file: http://svn.apache.org/viewvc/hadoop/core/trunk/src/examples/org/apache/hadoop/examples/SecondarySort.java