QnaList > Groups > Hive-User > Apr 2012
faq

Hive Equivalent Of Row_number()

I have a table with three columns, A, B, and Score, where A and B are some items, and Score
is some kind of affinity between A and B. There are N number of items of each A and B, so
that the total number of rows in the table are N^2.
Is there a way to fetch "top 5 items in B" for each item in A? So, for each distinct item
in A, I want to look up 5 items in B which have the highest value in Score.
If this were to be done in DB2, I would probably use some kind of windowing function using
row_number().

asked Apr 12 2012 at 20:43

Saurabh S's gravatar image



1 Replies for : Hive Equivalent Of Row_number()

Related discussions

Tagged

Group Hive-user

asked Apr 12 2012 at 20:43

active Apr 12 2012 at 20:46

posts:2

users:2

©2013 QnaList.com . QnaList is part of ZisaTechnologies LLC.