Skip to main content

Posts

Showing posts with the label avro schema generation

Apache Avro - Generating classes from Schema

This post is in continuation to my previous post on Apache Avro - Introduction . In this post, we will discuss about generating classes from Schema. How to create Apache Avro schema? There are two ways to generate AVRO classes from Schema. Pragmatically generating schema Using maven Avro plugin Consider we have following schema in " src/main/avro " { "type" : "record" , "name" : "Employee" , "namespace" : "com.gauravbytes.avro" , "doc" : "Schema to hold employee object" , "fields" : [{ "name" : "firstName" , "type" : "string" }, { "name" : "lastName" , "type" : "string" }, { "name" : "sex" , "type" : { "name" : "SEX" , "type" : "enum" , "symbols"