I'm using pig for data preparation, and I faced a problem which seems easy but I can't deal with:
for example, I have a column of names
name
------
Alicia
Ana
Benita
Berta
Bertha
then how can I add a row number for each name? the result would be like this:
name | id
----------------
Alicia | 1
Ana | 2
Benita | 3
Berta | 4
Bertha | 5
Thank you for reading this question!
Pig did not have a mechanism to do this when you asked this question. However, Pig 0.11 introduced a RANK operator that can be used for this purpose.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With