Reputation: 11
I need to "transpose" data that looks like this:
id City
111 Chicago
111 New York
111 LA
222 Paris
222 London
222 Tokyo
to:
111 Chicago New York LA
222 Paris London Tokyo
Every id would have three entries each, so the resulting relation would have 4 fields. I'm trying to avoid using a UDF. Any ideas?
Upvotes: 1
Views: 1407
Reputation: 1916
Isn't this basic grouping?
B = GROUP A BY id
Check http://pig.apache.org/docs/r0.7.0/piglatin_ref2.html#GROUP
Upvotes: 3