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

TimeConversions do not implement getRecommendedSchema()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.8.1
    • 1.9.0
    • None
    • None

    Description

      org.apache.avro.data.TimeConversions.TimestampConversion and other date and time conversions do not implement getRecommendedSchema(). When trying to dynamically generate an Avro schema from a pojo that contains a DateTime object using ReflectData, I get an unsupported operation exception.

      I think the implementation should be as simple as

      @Override
      public Schema getRecommendedSchema() {
            return LogicalTypes.timestampMillis().addToSchema(Schema.create(Schema.Type.LONG));
      }
      

      Attachments

        Issue Links

          Activity

            People

              timmsc Sean Timm
              timmsc Sean Timm
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: