Skip to content

Instantly share code, notes, and snippets.

@ibalashov
ibalashov / AvroReadTest.java
Created November 12, 2016 19:30
Reading broken avro file with DataFileReader does not produce any exception. fastavro duly complains on the same file.
% cat twitter.snappy.incomplete.avro
Objavro.codec
snappyavro.schema�{"type":"record","name":"twitter_schema","namespace":"com.miguno.avro","fields":[{"name":"username","type":"string","doc":"Name of the user account on Twitter.com"},{"name":"tweet","type":"string","doc":"The content of the user's Twitter message"},{"name":"timestamp","type":"long","doc":"Unix epoch time in milliseconds"}],"doc:":"A basic schema for storing Twitter messages"}5\�1��~����H����d�c
migunoFRock: Nerf paper, scissors is fine.���
BlizzardCSFWor%
% fastavro twitter.snappy.incomplete.avro
Traceback (most recent call last):
File "/usr/local/bin/fastavro", line 9, in <module>