Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-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 47DAF1020D for ; Tue, 4 Feb 2014 16:53:33 +0000 (UTC) Received: (qmail 66322 invoked by uid 500); 4 Feb 2014 16:53:23 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 66224 invoked by uid 500); 4 Feb 2014 16:53:22 -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 66217 invoked by uid 99); 4 Feb 2014 16:53:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Feb 2014 16:53:22 +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 (nike.apache.org: domain of akumarb2010@gmail.com designates 209.85.216.170 as permitted sender) Received: from [209.85.216.170] (HELO mail-qc0-f170.google.com) (209.85.216.170) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Feb 2014 16:53:14 +0000 Received: by mail-qc0-f170.google.com with SMTP id e9so14109685qcy.15 for ; Tue, 04 Feb 2014 08:52:54 -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=N9r3uHW4qHyIA/mXGbhDNVLOUFpgQMtzBorrV3Nv/f0=; b=ZzcGUoFbUOn1W7ENHTOaR5aYJVh+DewuqoLqtRm1pp9ZSdUaWUh8XPvH6cPaM1Wp7f PzL6PuGUsjwaJYo2S44/v8Pnplyqg4tQegazf/z6yh0GTq784/pE3hVHVw2fYvJze7tv uXkBualnzx5buxREVDI5kI+qIWh5iHMQ8taFmKwQwwEai05zdqGNqCZtdJKmfwFwk/G4 Xdgg8TiN9yvwMsF0aCYY0ALl+zS7nXI0wDXDVztVd8sbc7DAOlTXof42XVLDrcVZbn2o g9N9QaMYDg7DX2aICwaJxTc40l04dNRq1nSDCeOoICY29SeVp/wWVR0e/6vzfRKzYe2a XhZQ== MIME-Version: 1.0 X-Received: by 10.229.184.69 with SMTP id cj5mr67707474qcb.8.1391532773855; Tue, 04 Feb 2014 08:52:53 -0800 (PST) Received: by 10.96.193.3 with HTTP; Tue, 4 Feb 2014 08:52:53 -0800 (PST) In-Reply-To: References: Date: Tue, 4 Feb 2014 22:22:53 +0530 Message-ID: Subject: Re: shifting sequenceFileOutput format to Avro format From: AnilKumar B To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=001a11331fb4adf58204f19778f1 X-Virus-Checked: Checked by ClamAV on apache.org --001a11331fb4adf58204f19778f1 Content-Type: text/plain; charset=ISO-8859-1 I tried with different versions of avro-maven-plugin, with 1.7.5, 1.7.6 and with jdk1.7.0_45 version. I am unable to resolve it. Error message is as below: [ERROR] symbol: method deepCopy(org.apache.avro.Schema,java.util.Map) [ERROR] location: class org.apache.avro.generic.GenericData Thanks & Regards, B Anil Kumar. On Tue, Feb 4, 2014 at 12:06 AM, AnilKumar B wrote: > 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. >>>> >>> >>> >> > --001a11331fb4adf58204f19778f1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I tried with different versions of=A0avro-maven-plugin, wi= th 1.7.5, 1.7.6 and with=A0jdk1.7.0_45 version.

I am una= ble to resolve it.

Error message is as below:=
[ERROR] symbol: =A0 method deepCopy(org.apache.avro.Schema,java.u= til.Map<java.lang.CharSequence,java.lang.CharSequence>)
[ER= ROR] location: class org.apache.avro.generic.GenericData

Thanks & = Regards,
B Anil Kumar.


On Tue, Feb 4, 2014 at 12:06 AM, AnilKum= ar B <akumarb2010@gmail.com> wrote:
Can anyone please suggest on how to resolve this issue?

Than= ks & Regards,
B Anil Kumar.


On Mon, Feb= 3, 2014 at 9:34 AM, AnilKumar 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 &= amp; 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.




--001a11331fb4adf58204f19778f1--