Avro
  1. Avro
  2. AVRO-121

expected schema should be specifiable by specific & reflect datum readers

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: java
    • Labels:
      None

      Description

      The generic datum reader supports the specification of an 'expected' schema, that may differ from that used to write the data. The specific and reflect datum readers are based on the generic, but do not permit the specification of this and hence cannot support reading alternate versions of data.

      1. AVRO-121.patch
        0.9 kB
        Doug Cutting

        Activity

        Hide
        Doug Cutting added a comment -

        Adds a setExpected(Schema) method. Also, when the single-schema constructor is used, the expected schema now defaults to that passed in. This means that, when a so-constructed datum reader is passed to a container (e.g., a DataFileReader), and setSchema(Schema) is called with the schema used to write the container, the schema used in the constructor will be used as the "expected" schema, as intended.

        Show
        Doug Cutting added a comment - Adds a setExpected(Schema) method. Also, when the single-schema constructor is used, the expected schema now defaults to that passed in. This means that, when a so-constructed datum reader is passed to a container (e.g., a DataFileReader), and setSchema(Schema) is called with the schema used to write the container, the schema used in the constructor will be used as the "expected" schema, as intended.
        Hide
        Doug Cutting added a comment -

        I just committed this.

        Show
        Doug Cutting added a comment - I just committed this.

          People

          • Assignee:
            Doug Cutting
            Reporter:
            Doug Cutting
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development