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

Doug Cutting commented on AVRO-1582:
------------------------------------

The encoder/decoder abstraction is meant to be analagous with XML SAX parsers, 
an event-based parser that produces bytes from events or turns bytes into 
events.  The reader/writer abstraction is more like a an XML DOM API, taking an 
event stream and producing a data structure or vice versa.

https://en.wikipedia.org/wiki/Simple_API_for_XML

In Avro, binary and JSON encodings are implemented by different encoder/decoder 
pairs, while Generic, Specific, Reflect, Thrift, Json and ProtocolBuffer are 
alternate in-memory representations.  An application thus gets to pick its 
serialized encoding and its in-memory representation independently.  The events 
are the intermediate that makes this possible.

Is that what you were asking?

> Json serialization of nullable fileds and fields with default values 
> improvement.
> ---------------------------------------------------------------------------------
>
>                 Key: AVRO-1582
>                 URL: https://issues.apache.org/jira/browse/AVRO-1582
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.8.0
>            Reporter: Zoltan Farkas
>         Attachments: AVRO-1582-PATCH
>
>
> Currently serializing a nullable field of type union like:
> "type" : ["null","some type"]
> when serialized as JSON results in:  
> "field":{"some type":"value"}
> when it could be:
> "field":"value"
> Also fields that equal the the default value can be omitted from the 
> serialized data. This is possible because the reader will have the writer's 
> schema and can infer the field values. This reduces the size of the json 
> messages.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to