Last active
June 29, 2017 04:20
-
-
Save GopinathMR/e21b673d8f0d4a5d0b4324aba3de5e6f to your computer and use it in GitHub Desktop.
json-schema to AWS Athena bulk column format
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
#!/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