Reputation: 59
I have a a pig file with say 10000 rows. Is there any quick way where I can change the value of a certain column for say first 1000 rows ?
Upvotes: 1
Views: 763
Reputation: 2320
Since some info is missing, I will make a few assumptions, and then offer a solution.
$1
in first 1000 records when ordering by column $2
The following code snippet will do what you asked for:
a = load ...
b = rank a by $2;
c = foreach b generate $0, (rank_a<1000?$1:3*$1), $2..;
Upvotes: 1