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 102F56741 for ; Wed, 27 Jul 2011 21:15:19 +0000 (UTC) Received: (qmail 60692 invoked by uid 500); 27 Jul 2011 21:15:18 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 60590 invoked by uid 500); 27 Jul 2011 21:15:18 -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 60582 invoked by uid 99); 27 Jul 2011 21:15:17 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 21:15:17 +0000 Received: from localhost (HELO [10.0.0.231]) (127.0.0.1) (smtp-auth username scottcarey, mechanism login) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 21:15:17 +0000 User-Agent: Microsoft-MacOutlook/14.12.0.110505 Date: Wed, 27 Jul 2011 14:16:18 -0700 Subject: Re: compatibility with evolved schemas From: Scott Carey Sender: Scott Carey To: "user@avro.apache.org" Message-ID: Thread-Topic: compatibility with evolved schemas In-Reply-To: Mime-version: 1.0 Content-type: multipart/alternative; boundary="B_3394620990_89994023" > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3394620990_89994023 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit The code needs both schemas, and then it can resolve the difference between the schemas and read the old data using the new schema. In the Java API this usually means passing the old 'writer' schema as well as the new 'reader' schema to the object responsible for reading the data. As Doug described, the 'writer' schema must be available somehow, either by storing it with the data or from a reference. For example, the Avro Data File format stores the schema that all records in the file conform to in the file header. Then any reader can discover the written schema when opening the file. -Scott On 7/27/11 3:24 AM, "Giancarlo Frison" wrote: > Hi all, > > I'm wondering if it's possible to load stored records with extends schemas. > If I store a record with 3 fields, is it possible by any chance to load it by > an extended schema definition (for instance with one field more)? > I tried it but the serialized record is unreadable by the newest schema. What > I can do to accomplish this purpose? > > thanks, > > -- > > Giancarlo Frison > > http://gfrison.com > --B_3394620990_89994023 Content-type: text/html; charset="US-ASCII" Content-transfer-encoding: quoted-printable
The code needs both sch= emas, and then it can resolve the difference between the schemas and read th= e old data using the new schema.

In the Java API th= is usually means passing the old 'writer' schema as well as the new 'reader'= schema to the object responsible for reading the data.

=
As Doug described, the 'writer' schema must be available somehow, eithe= r by storing it with the data or from a reference.  For example, the Av= ro Data File format stores the schema that all records in the file conform t= o in the file header.  Then any reader can discover the written schema = when opening the file.

-Scott

<= /div>
On 7/27/11 3:24 AM, "Giancarl= o Frison" <gfrison@chelab.com>= wrote:

Hi all,

I'm wondering if it's possible to load store= d records with extends schemas.
If I store a record with 3 fields,= is it possible by any chance to load it by an extended schema def= inition (for instance with one field more)?
I tried it but the ser= ialized record is unreadable by the newest schema. What I can do to acc= omplish this purpose? 

thanks,

--

Giancarlo Frison


--B_3394620990_89994023--