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

Reply via email to