Memento "A retentive memory may be a good thing, but the ability to forget is the true token of greatness.” – Elbert Hubbard Assume you have a table with three columns: user, category and value. For each user, you want to select top N categories. To achieve this in hive, you can use the following query: SELECT * FROM ( SELECT *, rank(user) as row_number FROM ( SELECT user, category, value FROM $co