The results and ramblings of research


MR and Avro – Passing Avro through Pairs

leave a comment »

The mapper class is as follows:

public static class ReadData extends Mapper<AvroKey<XYZ>,NullWritable, Text, AvroValue<Pair>>{
      private final Text keyOut = new Text();
      private final AvroValue<Pair> valOut = new AvroValue<>();
      protected void map(AvroKey<XYZ>; key, NullWritable value, Context context) throws IOException, InterruptedException {
           XYZ data = key.datum();
           valOut.datum(new Pair<CharSequence, XYZ>(data.getOtherKey(), data));
           context.write(keyOut, valOut);


Written by anujjaiswal

April 20, 2015 at 5:03 pm

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: