Tags

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Problem Statement – Delhi Election has been done. There were around 250 candidates contesting for 70 constituencies. Election Commissioner want to calculate votes and declare results in a day.

Points,

1. There are many constituencies where candidates from each political party are contesting.

2. Every vote is done via Voting machine which generates a record i.e. CandidateName,PoliticalPartyName,Constituency

3. All votes are recorded in flat files and available in storage media.

Solution – 

1. Attach storage media to the machine which has big data environment(sandbox) installed.

2. Mount storage media as a secondary storage in sandbox.

3. Copy flat files(votes) to HDFS.

4. Create MapReduce function using JDeveloper and run on flat files.

5. Import generated reduced output to hive table.

6. Clean data to make it ready for queries.

7. Run HiveQL to generate winning candidates for each constituency.

Code Sample Attached Below(Please download file and change extension to .zip and then extract),

Includes – JDeveloper Project with MapReduce Code, Sample Data, Queries Used for data processing.

bigdata2

Detailed Steps for the solution – 

Advertisements