Skip to content

Instantly share code, notes, and snippets.

Created February 24, 2021 15:06
What would you like to do?
avro tricks
# get schema
java -jar ../avro-tools-1.10.1.jar getschema twitter.avro
# get meta
java -jar ../avro-tools-1.10.1.jar getmeta twitter.avro
#create avro
java -jar ../avro-tools-1.10.1.jar fromjson --schema-file twitter.avsc twitter.json > twitter.avro
# create avro with snappy
java -jar ../avro-tools-1.10.1.jar fromjson --codec snappy --schema-file twitter.avsc twitter.json > twitter.snappy.avro
# get data
java -jar ../avro-tools-1.10.1.jar tojson twitter.avro
java -jar ../avro-tools-1.10.1.jar tojson twitter.snappy.avro -pretty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment