Skip to content

Instantly share code, notes, and snippets.

@mitch-seymour
Last active December 16, 2019 17:33
Show Gist options
  • Save mitch-seymour/b02a810c8f94ccb26978743634936ade to your computer and use it in GitHub Desktop.
Save mitch-seymour/b02a810c8f94ccb26978743634936ade to your computer and use it in GitHub Desktop.
Avro!

Make sure you have avro-tools installed.

brew install avro-tools

# or...
mvn dependency:get -Dartifact=org.apache.avro:avro-maven-plugin:1.8.2
cp ~/.m2/repository/org/apache/avro/avro-tools/1.8.2/avro-tools-1.8.2.jar /usr/local/bin/avro-tools

Find the file you want to download:

gsutil ls gs://bucket

Download the Avro file to a local directory:

gsutil cp gs://bucket/objectname.avro ~/Downloads/example.avro

Read using avro-tools:

# update this as needed.
avro-tools tojson example.avro  | head -n1 | jq '.emails'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment