[ 
https://issues.apache.org/jira/browse/AVRO-1325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13654599#comment-13654599
 ] 

Tom White commented on AVRO-1325:
---------------------------------

I'm still concerned about the complexity this is added for casual schema 
writers. E.g. there are 6 overloaded type() methods after fields().name("f0"). 
What is the difference between intWith() and intType()?

bq. 1. Arbitrary properties are not supported, for example {"type":"string", 
"avro.java.string":"String"} can not be built.

I think this is easy to add to the existing SchemaBuilder by adding an 
addProp(String key, String value) method to the builders (RecordBuilder, 
FieldBuilder, ArrayBuilder). For FieldBuilder we could also have a 
addPropToType(String key, String value) method to distinguish between 
properties that are added to the underlying type, not the field itself.

bq. 2. SchemaBuilder.INT and other constants are public. Unfortunately, these 
are mutable, and anyone could call addProp() on these, affecting others.

I agree we need to fix this too. It can be done by changing the constants to 
methods, e.g. SchemaBuilder.intType(), and constructing a new Schema each time.

                
> Enhanced Schema Builder API
> ---------------------------
>
>                 Key: AVRO-1325
>                 URL: https://issues.apache.org/jira/browse/AVRO-1325
>             Project: Avro
>          Issue Type: Bug
>            Reporter: Scott Carey
>            Assignee: Scott Carey
>             Fix For: 1.7.5
>
>         Attachments: AVRO-1325-preliminary.patch
>
>
> The schema builder from AVRO-1274 has a few key limitations.  I have proposed 
> changes to make before it is released and the public API is locked in.

--
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

Reply via email to