I can\'t understand HiveQL rank(). I\'ve found a couple of implementations of rank UDF\'s on the WWW, such as Edward\'s nice example. I can load and access the functions, bu
With the Windowing and Analytics functions introduced in Hive 0.11, you can use:
select SalesRepId, volume as amount , rank() over (order by V.volume desc) as rank from
(select SalesRepId,sum(amount) as volume from purchases group by SalesRepId) V;