[Solved-2 Solutions] How to use Apache Pig rank function ?
What is Rank function ?
- Pig 0.11.0 rank function used for generating ranks for every data.
Syntax :
Problem :
How to use apache pig rank function ?
Solution 1:
- We can group data by id then use the UDF Enumerate to append an index to each tuple of the bags.
Solution 2:
- We can use RANK function as below: