avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Regarding Schema Resolution
Date Mon, 12 Sep 2011 19:27:36 GMT
Have you regenerated your specific code with the new schema?  If so,
then SpecificDatumReader should do what you want.  SpecificDatumReader
uses the schema that was used to generate the code.

Doug

On 09/12/2011 07:13 AM, Rohini U wrote:
> Hi,
> 
> I have a doubt about how I can use schema evolution with Avro. I was
> testing the schema resolution with Avro and I have a writer schema and a
> reader schema (which is slight modified version of writer schema, one
> field deleted). 
> While reading the data using the reader schema, can't I use the
> SpecificDatumReader<MyAvroGeneratedClass> for reading the data?
> 
> I am able to sucessfully read the data using GenericDatum Reader, but it
> woud be great if I can read it using SpecificDatumReader. My Schema is 
> long with quite a few fields and using GenericDatumReader would force me
> to populate all the fields myself after reading the GenericRecord. So I
> wanted to find out if there was a way to use SpecificDatumReader.
> 
> Thanks
> Rohini

Mime
View raw message