Skip to content

Instantly share code, notes, and snippets.

View mgraciano's full-sized avatar

Michel Graciano mgraciano

View GitHub Profile
@mgraciano
mgraciano / HelloAvro.java
Last active June 3, 2022 15:14
Concise example of how to write an Avro record out as file and parse it with embedded and custom schema in Java
package mgraciano;
import java.io.File;
import java.io.IOException;
import org.apache.avro.Schema;
import org.apache.avro.SchemaBuilder;
import org.apache.avro.file.DataFileReader;
import org.apache.avro.file.DataFileWriter;
import org.apache.avro.generic.GenericData;
import org.apache.avro.generic.GenericDatumReader;