Free Avro sample files
A compact binary data format that carries its own schema, widely used in data pipelines. Download valid Avro test files in 6 exact sizes, from 1 KB to 10 MB, each with a checksum.
- Extension
- .avro
- MIME type
- application/avro
- Kind
- Binary
- Category
- Data
Avro files by size
Every file below is a valid Apache Avro object container file file of exactly the stated size. Open a file's page for its checksum and contents. Avro files cannot be displayed by a browser, so their pages show the file's details instead of a preview.
| File | Size | Contents | Download |
|---|---|---|---|
| 1 KB Avro samplesample-avro-1kb.avro | 1 KB1,024 bytes | Records: 1 | Download Avro |
| 10 KB Avro samplesample-avro-10kb.avro | 10 KB10,240 bytes | Records: 78 | Download Avro |
| 100 KB Avro samplesample-avro-100kb.avro | 100 KB102,400 bytes | Records: 841 | Download Avro |
| 1 MB Avro samplesample-avro-1mb.avro | 1 MB1,048,576 bytes | Records: 8,622 | Download Avro |
| 5 MB Avro samplesample-avro-5mb.avro | 5 MB5,242,880 bytes | Records: 42,619 | Download Avro |
| 10 MB Avro samplesample-avro-10mb.avro | 10 MB10,485,760 bytes | Records: 85,116 | Download Avro |
What is an Avro file?
Avro is a row-oriented serialisation format from the Apache Hadoop project. Records are written in a dense binary encoding with no field names or type markers, which is only decodable with the schema that wrote them, so an Avro file stores that schema as JSON in its header.
After the header, records are grouped into blocks. Each block gives its record count and byte length and ends with a 16-byte sync marker taken from the header, which lets a reader split a large file between workers or skip a damaged block.
How to recognise an Avro file
Software recognises an Avro file by its file signature: fixed bytes at the start of the file, also called magic bytes or a magic number.
| Extension | .avro |
|---|---|
| MIME type | application/avro |
| Also seen as | avro/binary, application/octet-stream |
| Specification | Apache Avro 1.11 |
| Structure | Header with schema and codec, then data blocks with sync markers |
| Codecs | null and deflate required; snappy, zstandard, bzip2 and xz optional |
| Integers | Variable-length zigzag encoding |
What to test for
These are the behaviours that most often go wrong when software handles Avro files.
- A logical type is an annotation on a plain type: a date is stored as an int counting days since 1970. A reader that ignores the annotation returns a number where a date was expected.
- An Avro message taken from Kafka is not a container file. It has no header and no embedded schema, only a schema ID, so tools made for .avro files cannot open it.
- No media type is registered for Avro, so files arrive labelled application/octet-stream as often as anything else. Detection has to rely on the four signature bytes.
Strengths of Avro
- Compact binary records, with the schema stored in the file.
- Built for schema evolution: old and new readers can resolve each other's data.
Limitations of Avro
- Not human-readable; inspecting a file needs a tool.
- Row-oriented, so analytical queries over a few columns are slower than with a columnar format.
Typical uses of Avro test files
- Testing ingestion jobs and bulk loaders
- Checking schema resolution between a writer and a reader
- Verifying handling of logical types such as dates and UUIDs
- Load-testing readers with many blocks
Software that opens Avro
- Apache Spark, Flink and Hive
- Kafka Connect and schema registries
- Google BigQuery, Amazon Redshift and Snowflake, for bulk loading
- avro-tools, fastavro and the Apache Avro libraries
Specifications
Related
Avro sample files: questions
- What schema do the Avro samples use?
- A Customer record of twelve fields: a long, strings, a double, a boolean, an enum, a union with null, and two logical types, uuid and date. The schema is in the header of every file as JSON.
- Are the Avro samples compressed?
- No. They use the "null" codec, which every Avro library is required to support, so the records can also be inspected in a hex viewer.
- What is the MIME type of an Avro file?
- The MIME type is application/avro. You will also meet avro/binary and application/octet-stream in practice. The file extension is .avro.
- Is a sample Avro file the same as a dummy or example Avro file?
- Yes. Sample, test, dummy and example Avro files are different names for the same thing: an Avro file with known contents that stands in for a real one. Any file on this page will do wherever a tutorial or a test plan asks for a dummy Avro file.