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

Schema specification inconsistently describes default value for types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.10.0, 1.10.1, 1.10.2
    • None
    • None
    • None

    Description

      The Avro schema describes that types have default values, which seems to be inconsistent. Previously to 1.10, only fields had default values, but types did not. Since 1.10, the documentation for the map type states:

      For example, a map from string to long is declared with:

      {
       "type": "map",
       "values" : "long",
       "default": {}
       }

      Notice that the type declaration now carries a default value.

      The change was introduced with AVRO-2574. However, the parser currently (1.10.x) does not accept default values on types, but only on fields. The spec for the array type was modified in a similar fashion.

      We encountered this problem when implementing Avro support for Materialize, see https://github.com/MaterializeInc/materialize/issues/6433 for a bug on our end.

      Attachments

        Activity

          People

            Unassigned Unassigned
            antiguru Moritz Hoffmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: