avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: schema backward compatibility in RPC?
Date Mon, 30 May 2011 07:36:40 GMT
On 05/26/2011 10:10 PM, Yang wrote:
> I guess the schema resolution is done only on input params, and not on
> return value?

The same resolution should be done on return values.  For example,
changing the return value from one record to another would not work
(unless you used aliases) but adding or removing fields from a returned
record type should work.

> incidentally, I found that if I keep the name of an enum  type , but
> add new enum values to it (at the end of the value list), and then use
> the enum type as the return
> type of my RPC call, it still works, although strictly speaking, the
> enum type has already changed. but this is probably quite a dangerous
> hack.

That should not be dangerous.  Avro translates enum values so that
adding & removing symbols is permitted.  As long as the reader's schema
still has the symbol that the writer sends things should work.

Doug

Mime
View raw message