avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anand Nalya <anand.na...@gmail.com>
Subject Binary output in MR job
Date Sat, 16 Aug 2014 09:37:31 GMT
Hi,

I'm writing a MR 2 job in which I'm reading plain text as input and
producing avro output. On running the job in local mode, the output is
being serialized into json format. What can I do so that the output uses
binary encoding. Following is my job definition:

        Job job = new Job(getConf(), "Post convertor");
        job.setJarByClass(getClass());

        AvroJob.setOutputKeySchema(job, Post.getClassSchema());
        AvroJob.setMapOutputKeySchema(job, Schema.create(Schema.Type.LONG));
        AvroJob.setMapOutputValueSchema(job, Post.getClassSchema());

        FileInputFormat.addInputPath(job, new Path(args[0]));
        FileOutputFormat.setOutputPath(job, new Path(args[1]));

        job.setMapperClass(PostMapper.class);
        job.setReducerClass(PostReducer.class);

Regards.
Anand

Mime
View raw message