[
https://issues.apache.org/jira/browse/AVRO-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tom White updated AVRO-1274:
----------------------------
Attachment: AVRO-1274.patch
Doug - I didn't know about GenericRecordBuilder - that clears up the write
side. I've added some Javadoc to GenericData to make this clearer.
As for the read side, of course the point is that defaults are only used for
*new* fields in the reader schema, and my example failed because I was trying
to modify an *existing* field, which you can't do. The spec is actually pretty
clear on this: http://avro.apache.org/docs/current/spec.html#Schema+Resolution.
The latest patch should be ready for commit. I've added Javadoc to the whole
API, fixed the encoding of 'bytes' and 'fixed' default values (in a backwards
compatible way), and fixed the order of types in optional unions to [T, null]
so the default can be of type T. I also improved the API for specifying field
ordering so you don't need to know about Schema.Type.Order.
Josh - thanks!
> Add a schema builder API
> ------------------------
>
> Key: AVRO-1274
> URL: https://issues.apache.org/jira/browse/AVRO-1274
> Project: Avro
> Issue Type: New Feature
> Components: java
> Reporter: Tom White
> Assignee: Tom White
> Attachments: AVRO-1274.patch, AVRO-1274.patch, AVRO-1274.patch,
> AVRO-1274.patch, TestDefaults.patch
>
>
> It would be nice to have a fluent API that made it easier to construct record
> schemas.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira