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

Add object-value attribute support to SchemaBuilder.PropBuilder

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.9.0
    • java
    • None

    Description

      Add object-value attribute support to SchemaBuilder.PropBuilder.

      public final S prop(String name, Object value) 
      
      

      The avro 1.8.2 specification permits the use of undefined schema attributes as metadata:

      "Attributes not defined in this document are permitted as metadata, but must not affect the format of serialized data."

      The permitted types of attribute values is unclear from the above, but attributes with object values (non-string) are supported when parsing a schema and in the JsonProperties base class from which both Schema and Schema.Field inherit.

      JsonProperties supports object-valued attributes through its addProp() and getObjectProps() methods.

      In our use case, we need to programmatically normalize and augment user-supplied schemas which may contain attributes with object values like booleans and arrays of strings. The absence of a method in SchemaBuilder.PropBuilder which support object-valued attributes makes this difficult.

      Attachments

        1. AVRO-2067.patch
          13 kB
          Jeffrey Mullins

        Issue Links

          Activity

            People

              jmullins Jeffrey Mullins
              jmullins Jeffrey Mullins
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: