Return-Path: X-Original-To: apmail-hadoop-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-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 55F5B10445 for ; Mon, 3 Feb 2014 18:37:52 +0000 (UTC) Received: (qmail 46642 invoked by uid 500); 3 Feb 2014 18:37:29 -0000 Delivered-To: apmail-hadoop-user-archive@hadoop.apache.org Received: (qmail 46429 invoked by uid 500); 3 Feb 2014 18:37:23 -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 45996 invoked by uid 99); 3 Feb 2014 18:37:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Feb 2014 18:37:16 +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.174 as permitted sender) Received: from [209.85.216.174] (HELO mail-qc0-f174.google.com) (209.85.216.174) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Feb 2014 18:37:11 +0000 Received: by mail-qc0-f174.google.com with SMTP id x13so11582805qcv.5 for ; Mon, 03 Feb 2014 10:36:50 -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=15DBDHphgP/Fbpl/Ve3zbBpmV7ztayE5biVyoOycIVk=; b=iNiR5k6ZcPCI9IDZOd65DvLvthSossGmtzOMs4VbNmiamiH9TTXLGko0VZWzl3qAjY 8opccGCclNVoY4m1OO3MXgb8WRMmcZUbsI2pURURFZ/c4eyq1reAT15MQDZm5+ZgkBkt Q8XBTQNQD1m1X0BeNBBR7uzGXZRkBRNdBtQeX4y3peB4gz/5sKyP0PcxuPfarHYHe4zG MkZRKlfO7J8yek/AsiY9DcWo4ixt54pdZhnXjBVNkwMFgRhGu8PGKoLiw5jSAI9mRq4F Uzw6cr1F/abuI9xiNJjaoxRHq1fiJwwRloVMvu8VBboPjBgsl/IQXc+nCfxQp0KjqsO5 FGag== MIME-Version: 1.0 X-Received: by 10.140.97.137 with SMTP id m9mr54779929qge.95.1391452610771; Mon, 03 Feb 2014 10:36:50 -0800 (PST) Received: by 10.96.116.67 with HTTP; Mon, 3 Feb 2014 10:36:50 -0800 (PST) In-Reply-To: References: Date: Tue, 4 Feb 2014 00:06:50 +0530 Message-ID: Subject: Re: shifting sequenceFileOutput format to Avro format From: AnilKumar B To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=001a113a2b7a9641bf04f184cee6 X-Virus-Checked: Checked by ClamAV on apache.org --001a113a2b7a9641bf04f184cee6 Content-Type: text/plain; charset=ISO-8859-1 Can anyone please suggest on how to resolve this issue? Thanks & Regards, B Anil Kumar. On Mon, Feb 3, 2014 at 9:34 AM, AnilKumar B wrote: > Hi Yong, > > I followed your 2nd suggestion. My data format is is nested(list of map), > So I created .avsc as below. > > {"namespace": "test.avro", > "type": "record", > "name": "Session", > "fields": [ > {"name":"VisitCommon", "type": { > "type": "map", "values":"string"}, > {"name":"events", > "type": { > "type": "array", > "items":{ > "name":"Event", > "type":"map", > "values":"string"} > } > } > ] > } > > And I tried creating corresponding classes by using avro tool and with > plugin, but there are few errors on generated java code. What could be the > issue? > > 1) Error: The method deepCopy(Schema, > List>) is undefined for the type GenericData > 2) And also observed there is some deprecated code. > @Deprecated public > java.util.Map VisitCommon; > > I used eclipse plugin as mentioned below. > http://avro.apache.org/docs/1.7.6/mr.html > > > > > Thanks & Regards, > B Anil Kumar. > > > On Fri, Jan 31, 2014 at 8:27 AM, AnilKumar B wrote: > >> 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. >>> >> >> > --001a113a2b7a9641bf04f184cee6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Can anyone please suggest on how to resolve this issue?

Thanks & Regards,<= br>B Anil Kumar.


On Mon, Feb 3, 2014 at 9:34 AM, AnilKuma= r B <akumarb2010@gmail.com> wrote:
Hi Yong,

I followed your 2nd =A0suggest= ion. My data format is is nested(list of map), So I created .avsc as below.=

{"namespace": "test.avro"= ;,
=A0"type": "record",
=A0"name"= : "Session",
=A0"fields": [
=A0 =A0= {"name":"VisitCommon", "type": {
= =A0 =A0 =A0 =A0 =A0 =A0"type": "map", "values"= ;:"string"},
=A0 =A0{"name":"events",=A0
=A0 =A0 &quo= t;type": {
=A0 =A0 "type": "array",
=A0 =A0 "items":{
=A0 =A0 "name":= "Event",
=A0 =A0 = "type":"map",
=A0 =A0 "values":"string"}
=A0 =A0 }
=A0 = =A0 }
=A0]
}

And I tried= creating corresponding classes by using avro tool and with plugin, but the= re are few errors on generated java code. What could be the issue?

1) Error: The method deepCopy(Schema, List<Map<Ch= arSequence,CharSequence>>) is undefined for the type GenericData
2) And also observed there is some deprecated code.
=A0@Dep= recated public java.util.Map<java.lang.CharSequence,java.lang.CharSequen= ce> VisitCommon;

I used eclipse plugin as mentioned below.
= http://avro.apache.org/docs/1.7.6/mr.html




=
Thanks & Regards,
B Anil Kumar.


On Fri, Jan= 31, 2014 at 8:27 AM, AnilKumar B <akumarb2010@gmail.com> wrote:
Thanks Yong.

Thanks & Regards,
B Anil Kumar.


On Fri, Jan 31, 2014 at = 12:44 AM, java8964 <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 c= ustom 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.



--001a113a2b7a9641bf04f184cee6--