avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Youssef Hatem <youssef.ha...@rwth-aachen.de>
Subject Re: Schema Resolution for Enums
Date Fri, 27 Sep 2013 20:53:16 GMT
It makes perfect sense, thanks a lot Doug.


On Sep 27, 2013, at 21:02 , Doug Cutting wrote:

> On Thu, Sep 26, 2013 at 6:29 AM, Youssef Hatem
> <youssef.hatem@rwth-aachen.de> wrote:
>> All I can say is that we use the deserialized enum value as it is. So we get zero,
which is wrong since zero corresponds to something else in the reader enum.
> You need to translate enum values from the writer's to the reader's
> schema.  This is not difficult, since both are present when you're
> reading.  An array can be created that maps each value written into
> the corresponding value in the reader's schema.  In your example this
> would be [1,0,2,3], so that when you read a zero you return a 1.
> Doug

View raw message