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

Allow Java polymorphism in Avro for third-party code

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.7.6
    • None
    • java
    • None

    Description

      A large number of Java designs interacting with databases with Hibernate/Couchbase (perhaps, even otherwise) have Java polymorphism of the form:

      class Base 
      {
         Integer a = 5;
      }
      
      class Derived extends Base
      {
          String b = "Foo";
      }
      
      class PolymorphicDO
      {
         Base b = new Derived();
      }
      

      Jackson handles this kind of field by using annotations such as:

      @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class”)
      

      If such a thing can be added to Avro, all those Java designs could become immediately usable with Avro. They would also become Hadoop compatible due to AvroSerde.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sachingoyal Sachin Goyal
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated: