KalyanHadoopRealTimeProjects-2 / project-batch2-team3

project-batch2-team3
2 stars 0 forks source link

Real Time Big Data Projects Discussions #1

Open kalyanhadooptraining opened 6 years ago

cnivas commented 6 years ago

working on to get top 10 countries based on status "success"

chanakyajalda commented 6 years ago

this is my job1 output..

DE 4118 FR 1411 GB 5518 US 16348

so i have written mapper like the code given below

public class Job2Mapper extends Mapper<LongWritable, Text, Text, IntWritable> {

@Override
protected void map(LongWritable key, Text value,
        Context context)
        throws IOException, InterruptedException {
    String line = value.toString();
    System.out.println("Line: " + line);
    String[] words = line.split("\\t");
    Text country = new Text(words[0]);
    int status = Integer.parseInt(words[1]);
    IntWritable st = new IntWritable(Integer.valueOf(status));
    context.write(country, st);
}

but 1.i have to insert code to filter top 10 countries in mapper.. can any one give me suggestion. and

  1. will shuffle and sort do sorting automatically or we have write separate code for sort too?