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 045427198 for ; Tue, 15 Nov 2011 09:15:08 +0000 (UTC) Received: (qmail 72053 invoked by uid 500); 15 Nov 2011 09:15:08 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 71986 invoked by uid 500); 15 Nov 2011 09:15:07 -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 71978 invoked by uid 99); 15 Nov 2011 09:15:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Nov 2011 09:15:07 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [98.138.91.155] (HELO nm25-vm3.bullet.mail.ne1.yahoo.com) (98.138.91.155) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 15 Nov 2011 09:14:56 +0000 Received: from [98.138.90.54] by nm25.bullet.mail.ne1.yahoo.com with NNFMP; 15 Nov 2011 09:14:34 -0000 Received: from [98.138.89.174] by tm7.bullet.mail.ne1.yahoo.com with NNFMP; 15 Nov 2011 09:14:34 -0000 Received: from [127.0.0.1] by omp1030.mail.ne1.yahoo.com with NNFMP; 15 Nov 2011 09:14:34 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 328710.21349.bm@omp1030.mail.ne1.yahoo.com Received: (qmail 97316 invoked by uid 60001); 15 Nov 2011 09:14:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1321348474; bh=qKuGlJkYHXVtiKDwxv2Qm76gBR3K1lS/hAWPcCx3Xjs=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=j5YO4YvraNwAcTJtQ3u/dzw069AFLLQnBL8ul/lAtxH6vptAJc914NtbXNhqxNOTD7PATDII6zyu3TDC/+LU3oceT7dwU2LN463RFf6pvoqULPGGzA9GIkM56sX8KJbxFFSZ9xjc5LGtLCzZk+yqk3D6BA8P1SC9czTEiV4R6Gs= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=rMu7fA14ug5E6lAyfwDX04te2YRfPSEyLypdbRa+Bm3bMVsI6XwComgy0ez8hRcYt9fwLNiSijStT2Se2IY4ds/0FeBpW2I3mDp+eedjflbTsbgcvHjbkwUZxiG8uPnkDBFGBTf5p6fUWbyMdvFzmb9kCCOjmc3ll6dtZ1DQCWk=; X-YMail-OSG: e1LnLZ8VM1nZ_4jysUc5p3_BxLKMttC6GCjnyeywEVSRay3 JtxA0SNC7r6eBVpsDubvf9kg4clzqSs8SSUds3Oo6yyNtbnaEMhXjeqVKP1_ TtrgB0Ga0vsXlun.auIBqBbD5CguS_kvmhhq_zlhOgXSfVSn0_8oG7wq3ioM TQ77SlUoegCVLK8CnvGbEGXhsTBZrfT3cY87xHlF04jlYkNwpglWxVn_F1.D JvhS93GzZgkyba9iuY5AsjkY8U1kRUIcgSTol5YSt.xi6vaiZAzHCUHnES4Y GInlkqsmSlCrtGrfPa51a4oh1EEjy_nYOpTtUJ3ygavgvS8sP.nqfL.dDKD3 npk57HQtZN1.ycB12KEitXA63KkPZYZzzrd7XFyvNYJbfirZSIrjhDTqMTmm 8xYB5I3k- Received: from [212.227.66.11] by web120003.mail.ne1.yahoo.com via HTTP; Tue, 15 Nov 2011 01:14:33 PST X-Mailer: YahooMailWebService/0.8.115.325013 References: <1321286603.21822.YahooMailNeo@web120015.mail.ne1.yahoo.com> Message-ID: <1321348473.93752.YahooMailNeo@web120003.mail.ne1.yahoo.com> Date: Tue, 15 Nov 2011 01:14:33 -0800 (PST) From: Andrew Kenworthy Reply-To: Andrew Kenworthy Subject: Re: Exposing a constant in an Avro Schema To: "user@avro.apache.org" In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1007318780-76551027-1321348473=:93752" X-Virus-Checked: Checked by ClamAV on apache.org ---1007318780-76551027-1321348473=:93752 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Scott,=0A=0Ait's the latter I need; simply the ability to pass meta-data= with my schema, so the user property is just what I need.=0A=0AThanks for = your help!=0A=0AAndrew=0A=0A=0A=0A>________________________________=0A>From= : Scott Carey =0A>To: "user@avro.apache.org" ; Andrew Kenworthy =0A>Sent: Monday,= November 14, 2011 9:09 PM=0A>Subject: Re: Exposing a constant in an Avro S= chema=0A>=0A>=0A>Named types (records, fields, fixed, enum) can store arbit= rary user properties attached to the schema ( similar to "doc" but no speci= al meaning).=0A>=0A>=0A>Do you want this constant to be in every instance o= f your data object? =C2=A0If so, the enum is one way to do it. =C2=A0=0A>If= you simply want to push metadata along with the schema, use the schema pro= perties, they are name-value pairs. =C2=A0For example you can have "myVersi= on" attached to your schema for a record:=0A>=0A>=0A>{"type":"record", "nam= e":"bar.baz.FooRecord", "myVersion":"1.1", "fields": {=0A>=C2=A0 =C2=A0 {"n= ame":"field1", "type":"int"},=0A>=C2=A0 =C2=A0 =E2=80=A6=0A>=C2=A0 }=C2=A0= =0A>}=0A>=0A>On 11/14/11 8:03 AM, "Andrew Kenworthy" wrote:=0A>=0A>=0A>Hi,=0A>>=0A>>=0A>>I would like to "embed" a schema ver= sion number in the schema that I use for writing data: it would be read-onl= y so that I can determine later on which version of my avro schema was used= . The best I could come up with is to (ab)use an enum with a single value l= ike this, as I couldn't find any way to define a constant:=0A>>=0A>>=0A>>{"= type":"enum","name":"version_1_1","doc":"enum indicating avro write schema = version 1.1","symbols":["VERSION_1_1"]}=0A>>=0A>>=0A>>Is there a better way= to register a constant value that has no meaning within the avro data file= , other than to expose some kind of meta information?=0A>>=0A>>=0A>>Thanks,= =0A>>=0A>>=0A>>Andrew Kenworthy=0A>>=0A>>=0A>=0A> ---1007318780-76551027-1321348473=:93752 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hi Scott,

it's the latter I need; simply th= e ability to pass meta-data with my schema, so the user property is just wh= at I need.

Thanks for yo= ur help!

Andrew


From: Scott Carey <scottcarey@apache.org>
To: "user@avro.apache.org" <user@avro.apache.= org>; Andrew Kenworthy <adwkenworthy@yahoo.com>
Sent: Monday, November 14, 2011 9:09 PM
Subject: Re: Exposing a constant= in an Avro Schema

=0A
Named types (recor= ds, fields, fixed, enum) can store arbitrary user properties attached to th= e schema ( similar to "doc" but no special meaning).

Do you want this constant to be in every instance of your data object? &= nbsp;If so, the enum is one way to do it.  
If you simply wa= nt to push metadata along with the schema, use the schema properties, they = are name-value pairs.  For example you can have "myVersion" attached t= o your schema for a record:

{"type":"record", "nam= e":"bar.baz.FooRecord", "myVersion":"1.1", "fields": {
  &nb= sp; {"name":"field1", "type":"int"},
    =E2=80=A6
  } 
}

On 11/14/11 8:03 AM, "Andrew Kenworthy" = <adwkenworthy@yahoo.com> wrote:
<= div>
Hi,

I would like to "embed" a schema version number i= n the schema that I use for writing data: it would be read-only so that I c= an determine later on which version of my avro schema was used. The best I = could come up with is to (ab)use an enum with a single value like this, as = I couldn't find any way to define a constant:

{"type":"enum","name":"version_1_1","doc":"enum indicating avro wr= ite schema version=0A 1.1","symbols":["VERSION_1_1"]}

Is there a better= way to register a constant value that has no meaning within the avro data = file, other than to expose some kind of meta information?
=
Thanks,

A= ndrew Kenworthy

=0A


---1007318780-76551027-1321348473=:93752--