Conversion from Apache Avro IDL files to Avro Schama and Avro Protocol files

Conversion from Apache Avro IDL files to Avro Schama and Avro Protocol files

Avro schema registry hasn’t supprt storing of Avro IDL files yet, so one of the solutions to maintain consistency of Avro schemas is to use Avro IDL file as source of truth and generate avsc files based on it.

Requirements:

  • downloaded latest version of avro-tools.jar;
  • JDK 8 or Open JDK 8 installed;
  • prepared example.avdl file like below:

 

Conversion using avro-tools

 

How to generate avpr from avdl file

The result:

 

How to generate avsc from avdl file

The result:

 

 

 

If you think this tutorial is valuable, please leave me +1  or share it. This action will allow me to reach a wider audience.

Thank you.

3
Leave a Reply

avatar
2 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
3 Comment authors
lukasz.cieslaRikGkavya Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
kavya
Guest
kavya

Hi article is nice, java convert string to int is a frequently asked question in java interview.
Parsing is a process of converting one data type to another. For example String to integer.

RikG
Guest
RikG

great tutorial! Congrats.

By the way, is there a way to specify that some fields are mandatory/required?

Close Menu