Skip to content

Instantly share code, notes, and snippets.

@mjcreativeventures
Created February 15, 2016 05:19
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 mjcreativeventures/1ea573e0519eac2fc320 to your computer and use it in GitHub Desktop.
Save mjcreativeventures/1ea573e0519eac2fc320 to your computer and use it in GitHub Desktop.
Aggregate script
#!/bin/bash
if [ -z "$1" ]; then echo "Must supply DATE."; exit; fi
DATE="$1"
PIG_SCRIPT="aggregate.pig"
# totals are recalculated every time the script is executed
rm -rf totals
rm -rf daily/by_station/ds=$DATE
CMD=$(cat <<EOS
pig $PIG_OPTIONS -l /tmp -x local -p DATE=$DATE -f $PIG_SCRIPT
EOS)
echo $CMD
$CMD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment