Skip to content

Instantly share code, notes, and snippets.

@tuxfight3r
Created February 24, 2021 15:06
Show Gist options
  • Save tuxfight3r/236ebf9e6e23ed14b21d1f07e1248531 to your computer and use it in GitHub Desktop.
Save tuxfight3r/236ebf9e6e23ed14b21d1f07e1248531 to your computer and use it in GitHub Desktop.
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