avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lewis John Mcgibbney <lewis.mcgibb...@gmail.com>
Subject Re: Setting field default value's programmatically
Date Sun, 27 Oct 2013 18:48:25 GMT
Hi Doug,
Thanks for reading and for reply.

On Sun, Oct 27, 2013 at 5:25 PM, Doug Cutting <cutting@apache.org> wrote:

> That said,
> one could define an alternate method that returns a type-specific
> default value when none is specified.


This is more like what I had in mind. Until I discussed this with another
Gora committer and saw the rest of your reply I was not sure if this should
be addressed on the Gora-side or if it is something we can work on for
Avro.


> Alternately, one could traverse
> schemas and populate fields that have no specified default with a
> type-specific default.  I haven't looked at the Gora code in question,
> but perhaps there's an opportunity to pre-process the schemas there,
> prior to Avro code generation?
>
>
This sounds sensible and much more in fit with what we are after. This was
more or less what we were trying to achieve by setting the default value to
null (within the compiler) on a field-by-field basis if no default value
was explicitly specified within the Avro schema. I think we'll progress on
this basis.

Thanks for the thoughts.
Lewis

Mime
View raw message