Skip to content

Instantly share code, notes, and snippets.

@t3rmin4t0r
Last active March 17, 2020 20:30
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 t3rmin4t0r/a40801f2d5799723ca7827663e3b3268 to your computer and use it in GitHub Desktop.
Save t3rmin4t0r/a40801f2d5799723ca7827663e3b3268 to your computer and use it in GitHub Desktop.
TPC-DS dist to first_names.awk
grep "^add.*,.*," names.dst | \
sed -e "s/:/,/" -e "s/^add/,/" -e "s/;//" \
| awk 'BEGIN {print "create temporary table first_names(name String, male int, female int, neutral int);"} \
/^,/ {if(NR % 1000 == 1) {print "; insert into first_names values", substr($0,2)} else {print} } '\
> names.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment