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

ASF subversion and git services commented on AVRO-2067:
-------------------------------------------------------

Commit 82a57ada210dcda48a206b3ab47cb320a3e96bec in avro's branch 
refs/heads/master from [~jmullins]
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=82a57ad ]

AVRO-2067: Add object-value attrs to PropBuilder

Add object-value attribute support to SchemaBuilder.PropBuilder:
        public final S prop(String name, Object value)

JsonProperties supports object-valued attributes through its
addProp() and getObjectProps() methods.  Extend SchemaBuilder.PropBuilder
to also support object-valued attributes so that schemas with non-string
attributes can be created programmatically.


> Add object-value attribute support to SchemaBuilder.PropBuilder
> ---------------------------------------------------------------
>
>                 Key: AVRO-2067
>                 URL: https://issues.apache.org/jira/browse/AVRO-2067
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Jeffrey Mullins
>            Assignee: Jeffrey Mullins
>            Priority: Major
>         Attachments: AVRO-2067.patch
>
>
> Add object-value attribute support to _SchemaBuilder.PropBuilder_.
> {code:java}
> public final S prop(String name, Object value) 
> {code}
>     The avro 1.8.2 specification permits the use of undefined schema 
> attributes as metadata:
> {quote}    
> "Attributes not defined in this document are permitted as metadata, but must 
> not affect the format of serialized data."
> {quote}
>     
> The permitted types of attribute values is unclear from the above, but 
> attributes with object values (non-string) are supported when parsing a 
> schema and in the JsonProperties base class from which both Schema and 
> Schema.Field inherit.
>     
> _JsonProperties_ supports object-valued attributes through its _addProp()_ 
> and _getObjectProps()_ methods.
> In our use case, we need to  programmatically normalize and augment 
> user-supplied schemas which may contain attributes with object values like 
> booleans and arrays of strings. The absence of a method in 
> _SchemaBuilder.PropBuilder_ which support object-valued attributes makes this 
> difficult.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to