Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@GopinathMR
Last active June 29, 2017 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GopinathMR/e21b673d8f0d4a5d0b4324aba3de5e6f to your computer and use it in GitHub Desktop.
Save GopinathMR/e21b673d8f0d4a5d0b4324aba3de5e6f to your computer and use it in GitHub Desktop.
json-schema to AWS Athena bulk column format
#!/bin/bash
# $1 is json-schema file path
cat $1 | jq ".properties | to_entries[] | (.key + \" \" + .value.type)" | sed -e "s/integer/int/g" | sed -e "s/ \"$/ string\"/g" | sed -e "s/\"//g" | sed -e "s/$/,/g"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment