Skip to content

Instantly share code, notes, and snippets.

@sagarkarira
Last active May 29, 2019 09:33
Show Gist options
  • Select an option

  • Save sagarkarira/f3093301f27c374b83542a0528223308 to your computer and use it in GitHub Desktop.

Select an option

Save sagarkarira/f3093301f27c374b83542a0528223308 to your computer and use it in GitHub Desktop.
google bigquery commands most used by me.

####Listing all tables in a dataset

bq ls -n 9000 project:dataset

Deleting a table in dataset

bq delete -ft project:dataset:table

Deleting all table in a dataset

for i in $(bq ls -n 9999 my_dataset | grep keyword | awk '{print $1}'); 
do bq rm -ft my_dataset.$i; 
done;

Updating schema (Only way to update for records for now)

bq update project:dataset:tablename schema.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment