Search code examples
avro

What and why does avro use additional type values?


only recently I started to study kafka and Avro schemes, I can’t understand why there are such moments as "connect.version" and "connect.name" in the example

"name": "DATE_INCOME",
"type": ["null",{
         "type": "long",
         "connect.version": 1,
         "connect.name": "org.apache.kafka.connect.data.Timestamp",
         "logicalType": "timestamp-millis"}],
     "default": null}

As far as I know this is necessary for Schema Registry. And these additional fields are added with the help of java and maven


Solution

  • Those properties come from , which is a Java framework, yes. They're not added with maven. They are not native to Avro (the Avro spec should ignore parsing them), nor really used by any Schema Registry for anything, either.

    They can be used by Confluent AvroConverter to do additional type checking / parsing while deserializing client-side, but the attributes can be disabled by setting value.converter.connect.meta.data=false in Connect framework.