avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: How to add optional new record fields and/or new methods in avro-ipc?
Date Wed, 19 Oct 2011 17:32:25 GMT
On 10/19/2011 10:06 AM, Scott Carey wrote:
> In that case, Avro Java does not adhere to the spec.  I have had things
> like this as a field in Schemas I use for a long time (> 1 year, likely
> nearly 2)
> 
> {"name": "clientEnvironment", "type": [
>   {"name": "BrowserData", "type": "record", "fields" : [
>     {"name": "osName", "type": "string", "default": ""},
>     {"name": "browserVersion", "type": "string", "default": ""},
>     {"name": "flashVersion", "type": "string", "default": ""}
>   ]}, 
>   "null"
> ], "default":null}
> 
> 
> The default, null, is definitely not of type BrowserData.  Changing it to
> be strict about this would break much archived data.

Have you checked that this actually does what you think it should?
Several times folks have reported problems when "null" is not first in a
union for this very reason.  TestSchema#testUnion explicity tests that
such things fail.  So I'd be surprised if that default value actually works.

Doug

Mime
View raw message