Return-Path: X-Original-To: apmail-avro-user-archive@www.apache.org Delivered-To: apmail-avro-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 00D6011B31 for ; Sat, 16 Aug 2014 09:38:05 +0000 (UTC) Received: (qmail 37296 invoked by uid 500); 16 Aug 2014 09:38:04 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 37213 invoked by uid 500); 16 Aug 2014 09:38:04 -0000 Mailing-List: contact user-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@avro.apache.org Delivered-To: mailing list user@avro.apache.org Received: (qmail 37202 invoked by uid 99); 16 Aug 2014 09:38:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Aug 2014 09:38:04 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of anand.nalya@gmail.com designates 209.85.213.170 as permitted sender) Received: from [209.85.213.170] (HELO mail-ig0-f170.google.com) (209.85.213.170) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Aug 2014 09:37:33 +0000 Received: by mail-ig0-f170.google.com with SMTP id h3so4228477igd.3 for ; Sat, 16 Aug 2014 02:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=hSWya1L3oahIL9h5YPsj74kt21QSEQ5DpoJZBtSO+Fg=; b=LjYCBNlJRBub1pkUDrbsuvvWgZjv+Pwx3jv6ycPiA1+u1hyUveMGkHzxqDW1x3qdjA d/viMqval76UT06WTrMIlH2siS7jvQ5fytbAbbMqrx3uCw2OyxGR9TDqCw74bBZ3BKL2 oKWBRROAT4k5CKbP7y+BNR3ajuPtlxDDf+DVsysEbFY1gFEQW8XyRG4qyXzv72Tk9KNW 2XaNUvhzoxpIEKwI2yCUT589bTtA7/T3xthwbXsZ9jxlmHg5TV0R6FAxShwrNxA1LP7K v80+O3rl2ahyef46LVY9MqWIbtuJBcsIpzG5RrzJAn9IySmLKLZMM6fO+8iq3m3XcEWl 0sBQ== MIME-Version: 1.0 X-Received: by 10.43.129.74 with SMTP id hh10mr24785554icc.48.1408181851870; Sat, 16 Aug 2014 02:37:31 -0700 (PDT) Received: by 10.64.229.68 with HTTP; Sat, 16 Aug 2014 02:37:31 -0700 (PDT) Date: Sat, 16 Aug 2014 15:07:31 +0530 Message-ID: Subject: Binary output in MR job From: Anand Nalya To: user@avro.apache.org Content-Type: multipart/alternative; boundary=001a11c1ec9a0f5bdc0500bbe34a X-Virus-Checked: Checked by ClamAV on apache.org --001a11c1ec9a0f5bdc0500bbe34a Content-Type: text/plain; charset=UTF-8 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 --001a11c1ec9a0f5bdc0500bbe34a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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. Wha= t can I do so that the output uses binary encoding. Following is my job def= inition:

=C2=A0 =C2= =A0 =C2=A0 =C2=A0 Job job =3D new Job(getConf(), "Post convertor"= );
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 job.setJarByClass(getClass());

=C2=A0 =C2=A0 =C2=A0 =C2=A0 AvroJob.setOutputKe= ySchema(job, Post.getClassSchema());
=C2=A0 =C2=A0 =C2=A0 =C2=A0 AvroJob.setMapOutputKeySchema(= job, Schema.create(Schema.Type.LONG));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Avro= Job.setMapOutputValueSchema(job, Post.getClassSchema());
<= font face=3D"courier new, monospace">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 FileInputFormat.addInputP= ath(job, new Path(args[0]));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 File= OutputFormat.setOutputPath(job, new Path(args[1]));

=C2=A0 =C2=A0 =C2=A0 =C2=A0 job.setMapperClass(PostMapper.= class);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 job.= setReducerClass(PostReducer.class);

R= egards.
Anand
--001a11c1ec9a0f5bdc0500bbe34a--