Skip to content

Instantly share code, notes, and snippets.

@isdyy
Created June 27, 2015 17:55
Show Gist options
  • Save isdyy/4d6532bd05e0d3407c78 to your computer and use it in GitHub Desktop.
Save isdyy/4d6532bd05e0d3407c78 to your computer and use it in GitHub Desktop.
BigQuery のテーブルに後からカラムを追加する

これの回答がすべてだった: http://stackoverflow.com/questions/16702420/bigquery-add-columns-to-table-schema

現在のスキーマをダウンロード:

bq --format=prettyjson show yourdataset.yourtable > table.json

-> table.json を編集: fields の中身だけ ([ { "name": "x" ... }, ... ]) 残して全て消す. {"schema": ...} でも {"fields": [...]} でもなく、本当に [ {"name": "x" ... }, ... ] の部分だけを残す。

bq update yourdataset.yourtable table.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment