[Solved-2 Solutions] Pig: Pivoting & Sum 3 relations ?
Problem:
We have 3 different relations as mentioned below & we can get the output using UDFs but looking for implementation in PIG.
Proc:
Rej:
AllFN:
Output required is:
Solution 1:
The below code shows pivoting and summing of relations
Output for the above code
Solution 2:
- 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.