avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nigel Longton (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-1481) Create a new pair of datum reader/writer that set/omit default schema values
Date Fri, 14 Mar 2014 18:02:43 GMT

     [ https://issues.apache.org/jira/browse/AVRO-1481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Nigel Longton updated AVRO-1481:

    Attachment: AVRO-1481.patch

This was initially written to be completely outside of avro main. I feel that there is probably
a better solution to someone who know the json decoder code better than I do - the way to
track the current field and get the default value feels cludgy but it works for my data types.
Also I committed some test classes that could/should? be auto-generated but I don't know how
to do that.

> Create a new pair of datum reader/writer that set/omit default schema values
> ----------------------------------------------------------------------------
>                 Key: AVRO-1481
>                 URL: https://issues.apache.org/jira/browse/AVRO-1481
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.6
>            Reporter: Nigel Longton
>            Priority: Minor
>         Attachments: AVRO-1481.patch
> To create simpler json for consumption by non avro clients I created a reader/writer
pair that rather than use the union [null, type] model used a default null model. When the
writer creates json if the field value equals the default the field is not written to the
stream. Likewise when read, a missing field with a default is set to the default. If you like
these please include them in the next release (code attached as soon as I work out how). Am
working on a csharp version as well.

This message was sent by Atlassian JIRA

View raw message