You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Steve Roehrs (JIRA)" <ji...@apache.org> on 2013/07/08 03:57:48 UTC

[jira] [Created] (AVRO-1352) Schema for fixed types corrupted when writing out in JSON format

Steve Roehrs created AVRO-1352:
----------------------------------

             Summary: 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.4, 1.7.3, 1.7.2, 1.7.1, 1.7.0
            Reporter: Steve Roehrs
            Priority: Minor


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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira