Skip to content

Instantly share code, notes, and snippets.

@sursh
Last active December 29, 2015 03:09
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 sursh/7605439 to your computer and use it in GitHub Desktop.
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
#!/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