avro tricks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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