Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5DF9E10849 for ; Fri, 31 Jan 2014 02:58:02 +0000 (UTC) Received: (qmail 20824 invoked by uid 500); 31 Jan 2014 02:57:54 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 20453 invoked by uid 500); 31 Jan 2014 02:57:54 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 20446 invoked by uid 99); 31 Jan 2014 02:57:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jan 2014 02:57:54 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of akumarb2010@gmail.com designates 209.85.216.176 as permitted sender) Received: from [209.85.216.176] (HELO mail-qc0-f176.google.com) (209.85.216.176) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jan 2014 02:57:48 +0000 Received: by mail-qc0-f176.google.com with SMTP id e16so6332017qcx.35 for ; Thu, 30 Jan 2014 18:57:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ifT6zxzyUTwyMJPUWfY5m5wT7m41lrffatC988sbIeU=; b=mx/UxH+qhOsB1YqvK9/yZuYu363xQuQZ0sZU1j2z4K8VDfy1wKbidlaIXRjOw109Fz 2x5RLA3gs4nt7Dw1gaqIT+X/oy1J5pMIM1lzLy6kgvhGP9yqtb0eaxOFTSgcXnVc0Ap8 96tYJc6MjNuYLE6PbaWCtD02U4QeF2joq5Osx4OfsCjNx0y2hP6XYpcUSeprpIVC0IGP 5B+dz309SdL3XPkl7h3PHDQbeun0r8McmGcnXXcUK3L+CS15NnycMaBdHEnRsqco/Hoa S+K7iofZhLB3kJIcI8soAEg04+2fem14n9S/HQz+7LNujS/8k6/M5oBCi9nZ2eEdUwQM WFHg== MIME-Version: 1.0 X-Received: by 10.140.31.75 with SMTP id e69mr26447567qge.76.1391137047755; Thu, 30 Jan 2014 18:57:27 -0800 (PST) Received: by 10.96.116.67 with HTTP; Thu, 30 Jan 2014 18:57:27 -0800 (PST) In-Reply-To: References: Date: Fri, 31 Jan 2014 08:27:27 +0530 Message-ID: Subject: Re: shifting sequenceFileOutput format to Avro format From: AnilKumar B To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=001a113a96ca90c13404f13b5562 X-Virus-Checked: Checked by ClamAV on apache.org --001a113a96ca90c13404f13b5562 Content-Type: text/plain; charset=ISO-8859-1 Thanks Yong. Thanks & Regards, B Anil Kumar. On Fri, Jan 31, 2014 at 12:44 AM, java8964 wrote: > In avro, you need to think about a schema to match your data. Avor's > schema is very flexible and should be able to store all kinds of data. > > If you have a Json string, you have 2 options to generate the Avro schema > for it: > > 1) Use "type: string" to store the whole Json string into Avro. This will > be easiest, but you have to parse the data later when you use it. > 2) Use Avro schema to match your json data, using matching structure from > avro for your data, like 'record, array, map' etc. > > Yong > > ------------------------------ > Date: Fri, 31 Jan 2014 00:13:59 +0530 > Subject: shifting sequenceFileOutput format to Avro format > From: akumarb2010@gmail.com > To: user@hadoop.apache.org > > > Hi, > > As of now in my jobs, I am using SequenceFileOutputFormat and I am > emitting custom java objects as MR output. > > Now I am planning to emit it in avro format, I went through few blogs but > still have following doubts. > > 1) My current custom Writable objects has nested json format as > toString(), So when I shift to avro format, should I just emit json string > in avro format, instead of writable custom object? > > 2) If so, how can I create schema? My json string is nested and will have > random key/value pairs. > > 3) Or can I still emit as custom objects? > > > > Thanks & Regards, > B Anil Kumar. > --001a113a96ca90c13404f13b5562 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks Yong.

Thanks & Regards,
B Anil Kumar.


On Fri, Jan 31, 2014 at 12:44 AM, java89= 64 <java8964@hotmail.com> wrote:
In avro, you need to think about a schema to match yo= ur data. Avor's schema is very flexible and should be able to store all= kinds of data.

If you have a Json string, you have 2 op= tions to generate the Avro schema for it:

1) Use "type: string" to store the whole Json= string into Avro. This will be easiest, but you have to parse the data lat= er when you use it.
2) Use Avro schema to match your json data, u= sing matching structure from avro for your data, like 'record, array, m= ap' etc.

Yong


Date: Fri, 31 Jan 2014 00:13:59 +0= 530
Subject: shifting sequenceFileOutput format to Avro format
From: = akumarb2010@gmai= l.com
To: user@hadoop= .apache.org


Hi,

=
As of now in my jobs, I am using SequenceFileOutputFormat and I = am emitting custom java objects as MR output.

Now I am planning to emit it in avro format, I went thr= ough =A0few blogs but still have following doubts.

1) My current custom Writable objects has nested json f= ormat as toString(), So when I shift to avro format, should I just emit jso= n string in avro format, instead of writable custom object?=A0

2) If so, how can I create schema? My json string is nested = and will have random key/value pairs.

3) Or can I = still emit as custom objects?=A0



Thanks & Regards,
B Anil Kumar.

--001a113a96ca90c13404f13b5562--