alexholmes/hadoop-utils — pull request #1 by markcusack (2014-01-16 04:07:50+00:00)
Title: Add numeric ordering and user-defined row delimiters to sort

Hi Alex,

I've extended your sort command to include the ability to specify the row delimiter string, and also to provide support for numeric rather than lexicographic ordering.

The most significant change is the switch to ArrayWritables as map output keys from Text: each element of the array being a column value in the key. This allows numeric ordering to proceed in the event of ties.

I've only added support for sorting Longs, as this fits my requirements right now in terms of precision and scale. I did consider using BigDecimal to extend the support to fractional digits of precision, but I didn't want to compromise on performance.

I also added a switch for setting the mapred.task.timeout property, as I've seen reducer timeout issues on sorting larger files ~200GB on a single 8-core older machine.

Btw, I noticed that umask 022 needs to be set in the session prior to running the tests in order for the total order sort tests to complete.

Cheers,

Mark