You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Philip Henzler (JIRA)" <ji...@apache.org> on 2017/03/18 01:45:41 UTC

[jira] [Created] (AVRO-2010) multi dimensional array schema is not generated as expected

Philip Henzler created AVRO-2010:
------------------------------------

             Summary: multi dimensional array schema is not generated as expected
                 Key: AVRO-2010
                 URL: https://issues.apache.org/jira/browse/AVRO-2010
             Project: Avro
          Issue Type: Bug
          Components: c++
         Environment: Ubuntu 14.04, boost 1.62
            Reporter: Philip Henzler


I made the following change to the unittest.cc, adding a two dimensional array to the buildSchema() test:

{code}
ArraySchema array = ArraySchema(DoubleSchema());
const std::string s("myarray");
record.addField(s, array);

ArraySchema array2 = ArraySchema(ArraySchema(DoubleSchema()));
const std::string s2("my2dimarray");
record.addField(s2, array2);
{code}

It creates the following JSON schema output:

{code}
{
    "name": "myarray",
    "type": {
        "type": "array",
        "items": "double"
    }
},
{
    "name": "my2dimarray",
    "type": {
        "type": "array",
        "items": "double"
    }
}
{code}

Even tough I would expect the following output for the two dimensional case:

{code}
{
    "name": "my2dimarray",
    "type": {
        "type": "array",
        "items": {
            "type": "array",
            "items": "double"
        }
    }
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)