Question: Write a Map-Reduce application using Hadoop APIs to show the largest and the smallest city and their population for each country. In other words write

 Write a Map-Reduce application using Hadoop APIs to show the largest

Write a Map-Reduce application using Hadoop APIs to show the largest and the smallest city and their population for each country. In other words write three java class i.e. Mapper, Reducer and a Driver. Here is the screenshot of the dataset. It contains information about many cities of the countries of the world. The first line of the data file contains information about the fields, which are self-descriptive, as follows: "city" "city_ascii',"lat","lng","country","iso2","iso3","admin_name""capital","population","id" F G iso3 JPN IDN CN A B D E 1 city city_ascii lat Ing country iso2 2 Tokyo Tokyo 35.6897 139.6922 Japan JP 3 Jakarta Jakarta -6.2146 106.8451 Indonesia ID 4 Delhi Delhi 28.66 77.23 India IN 5 Mumbai Mumbai 18.9667 72.8333 India IN 6 Manila Manila 14.5958 120.9772 Philippines PH 7 Shanghai Shanghai 31.1667 121.4667 China CN 8 SVo Paulo Sao Paulo -23.5504 -46.6339 Brazil BR 9 Seoul Seoul 37.5833 127 Korea, South KR 10 Mexico City Mexico City 19.4333 -99.1333 Mexico MX 11 Guangzhou Guangzhou 23.1288 113.259 China 12 Beijing Beijing 39.905 116.3914 China CN 13 Cairo Cairo 30.0561 31.2394 Egypt EG 14 New York New York 40.6943 -73.9249 United State US 15 Kolk Ata Kolkata 22.5411 88.3378 India IN 16 Moscow Moscow 55.7558 37.6178 Russia RU 17 Bangkok Bangkok 13.75 100.5167 Thailand TH 18 Buenos Aires Buenos Aires -34.5997 -58.3819 Argentina AR 19 Shenzhen Shenzhen 22.535 114.054 China 20 Dhaka Dhaka 23.7161 90.3961 Bangladesh BD 21 Lagos Lagos 6.45 3.4 Nigeria NG 22 Istanbul Istanbul 41.01 28.9603 Turkey TR 23 -saka Osaka 34.6936 135.5019 Japan JP 24 Karachi Karachi 24.86 67.01 Pakistan PK 25 Bangalore Bangalore 12.9699 77.598 India IN 26 Tehran Tehran 35.7 51.4167 Iran IR 27 Kinshasa Kinshasa -4.3317 15.3139 Congo (Kinsh CD 28 Ho Chi Minh Ho Chi Minh 10.8167 106.6333 Vietnam VN 29 Los Angeles Los Angeles 34.1139 -118.4068 United State US 30 Rio de Janeir Rio de Janeir -22.9083 -43.1964 Brazil BR 31 Nanyang Nanyang 32.9987 112.5292 China 32 Chennai Chennai 13.0825 80.275 India IN 10cc IND IND PHL CHN BRA KOR MEX CHN CHN EGY USA IND RUS THA ARG CHN BGD NGA TUR JPN PAK IND IRN COD VNM USA BRA CHN IND H admin_name capital T=cky primary Jakarta primary Delhi admin MahfrfAsht admin Manila primary Shanghai admin Svo Paulo admin Seoul primary Ciudad de M primary Guangdong admin Beijing primary Al QfAhirah primary New York West Bengal admin Moskva primary Krung Thep primary Buenos Aires primary Guangdong minor Dhaka primary Lagos minor foostanbul admin =asaka admin Sindh admin KarnfAtaka admin TehrfAn primary Kinshasa primary H2 Chv Mi admin California Rio de Janeir admin Henan Tamil NfAdu admin K population id 37977000 1392685764 34540000 1360771077 29617000 1356872604 23355000 1356226629 23088000 1608618140 22120000 1156073548 22046000 1076532519 21794000 1410836482 20996000 1484247881 20902000 1156237133 19433000 1156228865 19372000 1818253931 18713220 1840034016 17560000 1356060520 17125000 1643318494 17066000 1764068610 16157000 1032717330 15929000 1156158707 15443000 1050529279 15279000 1566593751 15154000 1792756324 14977000 1392419823 14835000 1586129469 13707000 1356410365 13633000 1364305026 13528000 1180000363 13312000 1704774326 12750807 1840020491 12272000 1076887657 12010000 1156192287 11324000 1356374944 10 Write a Map-Reduce application using Hadoop APIs to show the largest and the smallest city and their population for each country. In other words write three java class i.e. Mapper, Reducer and a Driver. Here is the screenshot of the dataset. It contains information about many cities of the countries of the world. The first line of the data file contains information about the fields, which are self-descriptive, as follows: "city" "city_ascii',"lat","lng","country","iso2","iso3","admin_name""capital","population","id" F G iso3 JPN IDN CN A B D E 1 city city_ascii lat Ing country iso2 2 Tokyo Tokyo 35.6897 139.6922 Japan JP 3 Jakarta Jakarta -6.2146 106.8451 Indonesia ID 4 Delhi Delhi 28.66 77.23 India IN 5 Mumbai Mumbai 18.9667 72.8333 India IN 6 Manila Manila 14.5958 120.9772 Philippines PH 7 Shanghai Shanghai 31.1667 121.4667 China CN 8 SVo Paulo Sao Paulo -23.5504 -46.6339 Brazil BR 9 Seoul Seoul 37.5833 127 Korea, South KR 10 Mexico City Mexico City 19.4333 -99.1333 Mexico MX 11 Guangzhou Guangzhou 23.1288 113.259 China 12 Beijing Beijing 39.905 116.3914 China CN 13 Cairo Cairo 30.0561 31.2394 Egypt EG 14 New York New York 40.6943 -73.9249 United State US 15 Kolk Ata Kolkata 22.5411 88.3378 India IN 16 Moscow Moscow 55.7558 37.6178 Russia RU 17 Bangkok Bangkok 13.75 100.5167 Thailand TH 18 Buenos Aires Buenos Aires -34.5997 -58.3819 Argentina AR 19 Shenzhen Shenzhen 22.535 114.054 China 20 Dhaka Dhaka 23.7161 90.3961 Bangladesh BD 21 Lagos Lagos 6.45 3.4 Nigeria NG 22 Istanbul Istanbul 41.01 28.9603 Turkey TR 23 -saka Osaka 34.6936 135.5019 Japan JP 24 Karachi Karachi 24.86 67.01 Pakistan PK 25 Bangalore Bangalore 12.9699 77.598 India IN 26 Tehran Tehran 35.7 51.4167 Iran IR 27 Kinshasa Kinshasa -4.3317 15.3139 Congo (Kinsh CD 28 Ho Chi Minh Ho Chi Minh 10.8167 106.6333 Vietnam VN 29 Los Angeles Los Angeles 34.1139 -118.4068 United State US 30 Rio de Janeir Rio de Janeir -22.9083 -43.1964 Brazil BR 31 Nanyang Nanyang 32.9987 112.5292 China 32 Chennai Chennai 13.0825 80.275 India IN 10cc IND IND PHL CHN BRA KOR MEX CHN CHN EGY USA IND RUS THA ARG CHN BGD NGA TUR JPN PAK IND IRN COD VNM USA BRA CHN IND H admin_name capital T=cky primary Jakarta primary Delhi admin MahfrfAsht admin Manila primary Shanghai admin Svo Paulo admin Seoul primary Ciudad de M primary Guangdong admin Beijing primary Al QfAhirah primary New York West Bengal admin Moskva primary Krung Thep primary Buenos Aires primary Guangdong minor Dhaka primary Lagos minor foostanbul admin =asaka admin Sindh admin KarnfAtaka admin TehrfAn primary Kinshasa primary H2 Chv Mi admin California Rio de Janeir admin Henan Tamil NfAdu admin K population id 37977000 1392685764 34540000 1360771077 29617000 1356872604 23355000 1356226629 23088000 1608618140 22120000 1156073548 22046000 1076532519 21794000 1410836482 20996000 1484247881 20902000 1156237133 19433000 1156228865 19372000 1818253931 18713220 1840034016 17560000 1356060520 17125000 1643318494 17066000 1764068610 16157000 1032717330 15929000 1156158707 15443000 1050529279 15279000 1566593751 15154000 1792756324 14977000 1392419823 14835000 1586129469 13707000 1356410365 13633000 1364305026 13528000 1180000363 13312000 1704774326 12750807 1840020491 12272000 1076887657 12010000 1156192287 11324000 1356374944 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!