I was trying to find the average marks per branch in any college.
I ran below Pig transformation script.
grunt> student = LOAD "/user/cloudera/User/student_details.txt" USING PigStorage(",") AS (rollNo:int, name:charArray, branch:charArray, marks:int);
grunt> student_group_branch = GROUP student By branch;
grunt> AverageMarks = ForEach student_group_branch GENERATE (student.branch, AVG(student.marks));
grunt> dump AverageMarks;
The result of dump command is as below
(({( CSE),( CSE),( CSE)},913.6666666666666))
(({( Civil),( Civil)},999.5))
(({( ECE),( ECE)},994.5))
(({( EEE),( EEE)},943.0))
grunt>
However, I was looking for the output as below
CSE, 913.66
Civil, 999.5
ECE, 994.5
EEE, 943.0
Could you please help in getting the desired Output?