There are several cities, with a daily temperature provided for each city, and we have to calculate the city's average salary. However, there are certain rules to calculate the average. After calculating the city-wise total for each city, we can compute the average of temperature for each city:
Input Files (several files) |
Map (Parallel) (, Value = Name) |
Combiner (Parallel) |
Reducer (Not Parallel) |
Output |
City 1 |
1<10,20,25,45,15,45,25,20> 2 <10,30,20,25,35> |
1 <250,20> 2 <120,10> |
1 Boston, < 250,20,155, 10,90,90,30> 2 New York, <120,10,175,10,135, 10,110,10,130,10> |
Boston <645> New York <720> |
City 2 |
1<Boston> 2 <New York> |
1 <Boston> 2 <New York> |
|
|
Now, let's look at the complete example ...