hive 函数学习

NAME PRICE
---- -----
AAA 1.59
AAA 2.00
AAA 0.75
BBB 3.48
BBB 2.19
BBB 0.99
BBB 2.50

I would like to get target table:

RANK NAME PRICE
---- ---- -----
1 AAA 0.75
2 AAA 1.59
3 AAA 2.00
1 BBB 0.99
2 BBB 2.19
3 BBB 2.50
4 BBB 3.48

Normally I would use ROW_NUMBER() OVER function, so in Apache Hive it would be:

select
row_number() over (partition by NAME order by PRICE) as RANK,
NAME,
PRICE
from
MY_TABLE
;
上一篇:Scrapy框架的执行流程解析


下一篇:linux查看网络信息命令