Skip to content

Instantly share code, notes, and snippets.

@vvakame
Created March 2, 2016 01:58
Show Gist options
  • Save vvakame/fff0e13cbd19c2400c9e to your computer and use it in GitHub Desktop.
Save vvakame/fff0e13cbd19c2400c9e to your computer and use it in GitHub Desktop.
BigQueryのDatasetの中のTable全部消すマン

事前準備

$ gcloud components update
$ brew install gnu-sed

がんばる

$ bq --project_id foo --dataset_id bar ls -a --max_results 1000 | grep TABLE > table.txt
$ gsed -i "s/\sTABLE//g" table.txt
$ cat table.txt | xargs -n 1 bq --project_id foo --dataset_id bar rm -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment