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

[ReflectData] Provide a way for parameterised types to be nullable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7.0
    • 1.7.6
    • java
    • None

    Description

      Although possible with SpecificData (schema generated classes), the ReflectData currently lacks a way to have a declaration such as

      java.util.List<String> myList;

      to be able to generate a nullable schema

      { "type": "array", "items": ["null", "string"] }

      instead of the current

      { "type": "array", "items": "string" }

      There are @Union and @Nullable annotations available, but they cannot be applied to the above parameterised Collection declaration.

      Attachments

        1. AVRO-1421.patch
          7 kB
          Doug Cutting
        2. AVRO-1421.patch
          5 kB
          Doug Cutting

        Activity

          People

            cutting Doug Cutting
            qwertymaniac Harsh J
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: