Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2010

multi dimensional array schema is not generated as expected

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.9.0
    • c++
    • None
    • Ubuntu 14.04, boost 1.62

    Description

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

      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);
      

      It creates the following JSON schema output:

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

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

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

      Attachments

        Issue Links

          Activity

            People

              thiru_mg Thiruvalluvan M. G.
              phhe Philip Henzler
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: