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

Emit default values from resolved reader during schema evolution/projection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.7.4
    • None
    • c
    • None
    • avro-c, schema evolution, return default values for fields not present in writer schema.

    • avro-c

    Description

      Default values are not being returned by a resolved reader schema for fields that were not present in the writer schema.

      The code that demonstrates this issue can be found in this gist (https://gist.github.com/claws/5069264). It is a slightly modified version of an example by Douglas Creager.

      The section of interest is the READER_SCHEMA_C where a new field is added (to simulate schema evolution). In the main function the line:

      read_with_schema_resolution(FILENAME, READER_SCHEMA_C, "c");

      which is intended to display the default value for field 'c', as this field is not present in the writer schema. This does not happen. Instead an error is reported:

      Error: Reader field c doesn't appear in writer

      This error indicates that the avro-c implementation does not appear to support returning default values.

      While posting about my avro problems on the avro user mailing list Douglas Creager indicated that the avro-c implementation does not support this functionality and suggested that a JIRA issue be raised.

      Attachments

        Activity

          People

            Unassigned Unassigned
            claws Chris Laws
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: