[Solved-2 Solutions] Pig: Pivoting & Sum 3 relations ?
We have 3 different relations as mentioned below & we can get the output using UDFs but looking for implementation in PIG.
Output required is:
The below code shows pivoting and summing of relations
Output for the above code
- The way to do it without UDF is to group on Id and than in nested foreach select rows for each of the column names, then join them in the generate.