avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Roehrs (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-1352) Schema for fixed types corrupted when writing out in JSON format
Date Tue, 03 Jun 2014 05:28:02 GMT

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

Steve Roehrs updated AVRO-1352:
-------------------------------

    Attachment: AVRO-1352-Test.patch

A patch to the Avro C++ test suite to add a test case for this bug. Test fails on trunk, passes
after patch.

> Schema for fixed types corrupted when writing out in JSON format
> ----------------------------------------------------------------
>
>                 Key: AVRO-1352
>                 URL: https://issues.apache.org/jira/browse/AVRO-1352
>             Project: Avro
>          Issue Type: Bug
>          Components: c++
>    Affects Versions: 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4
>            Reporter: Steve Roehrs
>            Priority: Minor
>              Labels: patch,
>             Fix For: 1.7.7
>
>         Attachments: AVRO-1352-Test.patch, AVRO-1352.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> A change made in NodeImpl.cc under AVRO-1026 has introduced a bug that corrupts JSON
schemas when writing them to disk or dumping to a stream.  This manifested when using DataFileWriter
to generate a data file, and the schema stored in the header was corrupted from the original
schema provided.
>  
> e.g 
>  
> This:
> {noformat}
> {
>   “type”: “fixed”,
>   “name”: “Unsigned16”,
>   “size”: 2
> }
> {noformat}
>  
> Becomes this:
> {noformat}
> {
>   “type”: “fixed”,
>   “size”: 2,
>   “name” : “Unsigned16”,
> }
> {noformat}
> Note the extraneous comma after the ‘name’ attribute.
> The bug exists for Avro 'fixed' types, and has not been observed for other types. A test
case will be developed.
> The bug can be fixed by simply re-ordering the code in NodeFixed::printJson.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message