目次
- bqコマンドで既存テーブル構成のjson取得
- 子フィールド追加のためjson編集
- bqコマンドで子フィールド追加
詳細
サンプルテーブルの構成 1. bqコマンドで既存テーブル構成のjson取得
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
bq show --format=prettyjson --schema project:dateset.table > table.json cat table.json [ { "mode": "NULLABLE", "name": "id", "type": "INTEGER" }, { "fields": [ { "description": "\u540d\u524d", "mode": "NULLABLE", "name": "name", "type": "STRING" }, { "description": "\u5e74\u9f62", "mode": "NULLABLE", "name": "age", "type": "INTEGER" }, { "description": "\u56fd", "mode": "NULLABLE", "name": "country", "type": "STRING" } ], "mode": "NULLABLE", "name": "person", "type": "RECORD" } ] |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
vi table.json [ { "mode": "NULLABLE", "name": "id", "type": "INTEGER" }, { "fields": [ { "description": "\u540d\u524d", "mode": "NULLABLE", "name": "name", "type": "STRING" }, { "description": "\u5e74\u9f62", "mode": "NULLABLE", "name": "age", "type": "INTEGER" }, { "description": "\u56fd", "mode": "NULLABLE", "name": "country", "type": "STRING" }, { "description": "", "mode": "NULLABLE", "name": "hoby", "type": "STRING" } ], "mode": "NULLABLE", "name": "person", "type": "RECORD" } ] |
1 |
bq update project:dateset.table table.json |