Last active
December 29, 2015 03:09
-
-
Save sursh/7605439 to your computer and use it in GitHub Desktop.
Little bash script to make a schema for Pig out of your logfile CSV. Just pipe in any CSV with a header row and you're good to go. Note: puts chararrays for all fields. Setup: Store in /usr/local/bin/schemaify.sh Usage: cat logfile.csv | schemaify.sh | pbcopy
paste into your pigscript
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 | |
head -n 1 | sed 's/,/:chararray, /g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment