I already have a table created using Pig. Now I want to add a random number with every row(record) to give me a new table with this added column.
Is this possible and how ?
You may use the RANDOM UDF for this purpose.
E.g:
A = ...
B = foreach A generate (int)(RANDOM()*100.0) as rnd, [other fields...]
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