spotify/crunch-lib — pull request #3 by DavW (2014-11-14 13:43:57+00:00)
Title: Averages.percentiles(PTable<K, V extends Number>, p...) 

Averages.percentiles to calculate percentiles by key.

Percentiles are calculated on a per-key basis by counting, joining and sorting. This is highly scalable, but takes
2 more map-reduce cycles than if you can guarantee that the value set will fit into memory. The percentile
definition that we use here is the "nearest rank" defined here: http://en.wikipedia.org/wiki/Percentile#Definition

You should definitely use a different strategy for situations where we know the set will fit into memory. Perhaps
this should be implemented as well.