Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. public class FirstJobMapper extends Mapper<LongWritable, Text, Text, Text> {
  2.  
  3.     public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
  4.  
  5.         String record = value.toString();
  6.         String[] parts = record.split(",");
  7.  
  8.         if (!parts[0].equals("RIDE_ID") && !parts[5].isEmpty()) {
  9.             Text carCategory = new Text(parts[12]);
  10.             Text distance = new Text(parts[5]);
  11.  
  12.             context.write(carCategory, distance);
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement