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

Ryan Blue commented on AVRO-1618:
---------------------------------

bq. I think it depends what you mean about making the parsing process "real."

I mean something that works like the BinaryDecoder, so the objects returned 
from the stream are valid and conform to the read schema. It looks like we're 
talking about the same thing.

I just want to avoid building pieces of a JsonDecoder that have to be used 
separately to get the right functionality. What you have here already crawls a 
schema and associated object to fix things, maybe we could build a JsonDecoder 
out of this without too much trouble, even if it is limited for now. For 
example, we don't have to build schema resolution into the JSON decoder yet. We 
could produce objects that conform to the write schema, but make sure they 
conform to the Schema rather than returning the raw underlying JSON.

I think that would amount to basically what you've done here, plus the ability 
to decode a stream of records as serialized to the Avro JSON spec. We could 
consider those two separate pieces though, and just get the first part done for 
this issue: a utility method that translates a raw JSON object into an object 
that conforms to the write schema. Then we can add parsing a stream of JSON 
records later.

> Allow user to "clean up" unions into more conventional dicts in json encoding
> -----------------------------------------------------------------------------
>
>                 Key: AVRO-1618
>                 URL: https://issues.apache.org/jira/browse/AVRO-1618
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>    Affects Versions: 1.7.7
>            Reporter: Aaron Kimball
>            Assignee: Aaron Kimball
>         Attachments: avro-1618.1.patch
>
>
> In Avro's JSON encoding, unions are implemented in a tagged fashion; walking 
> through this data structure is somewhat cumbersome. It would be good to have 
> a way of "decoding" this tagged-union data structure into a more conventional 
> dict where the union element is directly present without the tag.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to