hive取topN的窗口函数
三种分别是rank() over(),dense_rank() over(),row_number() over()
select wj_like_game,wj_chonezhi_money,rank() over (partition by wj_like_game order by wj_chonezhi_money desc ) rk, dense_rank() over (partition by wj_like_game order by wj_ChoneZhi_Money desc )dr, row_number() over (partition by wj_like_game order by wj_ChoneZhi_Money desc ) rn from wj_plyfor_game
从红圈中可以看得出,rank()over()当遇到相同的会停留,但是会跳跃,dense_rank() over()不跳跃,但是遇到相同的会停留,row_number() over()属于正常的。