Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
avro tricks
#code: https://github.com/miguno/avro-cli-examples
# 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