Return-Path: Delivered-To: apmail-avro-user-archive@www.apache.org Received: (qmail 76000 invoked from network); 16 Sep 2010 08:34:53 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Sep 2010 08:34:53 -0000 Received: (qmail 56301 invoked by uid 500); 16 Sep 2010 08:34:52 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 56056 invoked by uid 500); 16 Sep 2010 08:34:50 -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 56047 invoked by uid 99); 16 Sep 2010 08:34:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Sep 2010 08:34:49 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Robin.Mueller@1und1.de designates 212.227.126.201 as permitted sender) Received: from [212.227.126.201] (HELO mxintern.schlund.de) (212.227.126.201) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Sep 2010 08:34:39 +0000 Received: from [10.2.3.43] (helo=exnlb01.webde.local) by mxintern.schlund.de with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (envelope-from ) id 1Ow9v9-0007dP-PN for user@avro.apache.org; Thu, 16 Sep 2010 10:34:19 +0200 Received: from exnlb11.webde.local (172.19.74.11) by exnlb01.webde.local (10.2.3.43) with Microsoft SMTP Server (TLS) id 8.2.254.0; Thu, 16 Sep 2010 10:34:04 +0200 Received: from [172.17.12.69] (212.227.35.68) by smtp.extranet.1and1.com (217.72.200.71) with Microsoft SMTP Server (TLS) id 8.2.254.0; Thu, 16 Sep 2010 10:34:04 +0200 Message-ID: <4C91D67C.7000707@1und1.de> Date: Thu, 16 Sep 2010 10:34:04 +0200 From: =?ISO-8859-1?Q?Robin_M=FCller?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100826 Lightning/1.0b1 Thunderbird/3.0.7 MIME-Version: 1.0 To: Subject: Re: Versioning of an array of a record References: <4C91D0D5.5050601@1und1.de> <303B07CD-F59B-4876-93B7-D112E66F0EEE@richrelevance.com> In-Reply-To: <303B07CD-F59B-4876-93B7-D112E66F0EEE@richrelevance.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Symantec AntiVirus Scan Engine X-UI-Msg-Verification: f53a8244c4fb78154a91dffd493d5bb4 X-Virus-Checked: Checked by ClamAV on apache.org Thanks for the fast reply. I use the implementation for avro-serialization from voldemort=20 (key-value-store) and it seems that they don't use the ResolvingDecoder.=20 But I think there is a way to use an own implementation for the=20 serialization in voldemort. So I'll give it a try with the ResolvingDecoder= . Greetings, Robin Am 16.09.2010 10:21, schrieb Scott Carey: > Assuming Java: Are you using a ResolvingDecoder? > > This will happen by default if you are reading Generic or Specific record= s from an Avro File, but if you are reading data otherwise, you have to use= a ResolvingDecoder to specify the expected (reader) and actual (writer) s= chemas. > > On Sep 16, 2010, at 1:09 AM, Robin M=FCller wrote: > > =20 >> Hi, >> >> I've read the part "Schema Resolution" of the Avro Specification. So I >> think that avro supports versioning of the schema. >> But when I try to change to following schema, an AvroTypeException will >> be thrown by reading data that was serialized with the old schema: >> { >> "name":"BrowserCountArray", >> "type":"record", >> "fields": [ >> { >> "name":"BrowserCounts", >> "type": >> { >> "type":"array", >> "items": { >> "name": "BrowserCount", >> "type": "record", >> "fields": [ >> { >> "name":"Browser", >> "type":"string" >> }, { >> "name":"Count", >> "type":"int" >> }] >> } >> } >> }] >> } >> >> For example I add a new field to the BrowserCount record like this: >> >> { >> "name":"BrowserCountArray", >> "type":"record", >> "fields": [ >> { >> "name":"BrowserCounts", >> "type": >> { >> "type":"array", >> "items": { >> "name": "BrowserCount", >> "type": "record", >> "fields": [ >> { >> "name":"Browser", >> "type":"string" >> }, { >> "name":"Count", >> "type":"int" >> }, { >> "name":"Blub", >> "type":"int", >> "default":"0" >> }] >> } >> } >> }] >> } >> >> Is it possible to add or remove fields from this record and read with >> this new schema data, that was serialized with an old one. >> Or is there another way to define an array of record which solves that >> problem. >> >> Thanks, >> Robin >> =20 > =20