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

Raymie Stata commented on AVRO-50:
----------------------------------

The spec for JSON records does not indicate whether or not records-fields in 
the JSON syntax need to appear in the order they're specified in the Avro 
schema.  It would be helpful if they did: the current usage-pattern of the 
value-reader (and -writer) API is that values come in-order, so out-of-order 
arrival would be very disruptive.

On this point, the JSON serialization format might be a different from the 
Avro-schema format used for default values.  In the case of default values, 
these are written primarily by users, who would really appreciate a format 
that's forgiving regarding the order of fields.  And the code that processes 
these values can easily adjust the order without impacting clients of the 
overall Avro API.  So order insensitivity makes sense in this context.

However, the JSON serialization format is written primarily by machines, which 
don't care about this sensitivity.  And, as just indicated, there is a 
non-trivial cost to allowing out-of-order in serialized values themselves.  So 
order sensitivity makes sense here.

So I propose that the default-values be insensitive to order and the 
serialization format be order-sensitive.

> bidrectional text representation of AVRO data
> ---------------------------------------------
>
>                 Key: AVRO-50
>                 URL: https://issues.apache.org/jira/browse/AVRO-50
>             Project: Avro
>          Issue Type: New Feature
>          Components: spec
>            Reporter: Philip Zeyliger
>            Assignee: Doug Cutting
>         Attachments: AVRO-50.patch
>
>
> It would be very useful to add a text representation of AVRO data to the 
> spec, and implement toString() and fromString() in all implementations.  
> Faced with binary data, it'll be a useful operation to decode it for 
> debugging, ad-hoc manipulation, etc.
> I suspect the text format will:
>  * be JSON
>  * require the schema for full interpretation
>  * map easily onto the binary format (if the binary format has a signifier to 
> take a specific branch of a union, the text format will have such a signifier 
> as well)
>  * not be unique (there's more than one way to encode a given number (e.g., 
> {{0x0 == 0}}) or string (e.g., {{"\u0061" == "a"}}, not to mention flexible 
> whitespace)
>  * be compatible, for the binary type, with whatever is decided in AVRO-36

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to