LoginSignup
4
3

More than 5 years have passed since last update.

コマンドラインで不要なBigQueryのテーブルを消す

Posted at

あらすじ

検証環境で、不要なテーブルを大量に作ってしまったので一斉に削除したかった。Web画面では、1つづつしか削除できなそう。

コマンド

検証環境でしかTryしてないので、くれぐれも注意です。awkで正規表現まっち

# 削除対象を確認
bq ls -n 1000 dataset | awk '/フィルタ条件/{ print "dataset."$1 }' 

# 削除
bq ls -n 1000 dataset | awk '/フィルタ条件/{ print "dataset."$1 }' | xargs -n 1 -t bq rm -f
4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3