avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Carey <scottca...@apache.org>
Subject Re: compatibility with evolved schemas
Date Wed, 27 Jul 2011 21:16:18 GMT
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.


On 7/27/11 3:24 AM, "Giancarlo Frison" <gfrison@chelab.com> 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

View raw message