LoginSignup
5
4

More than 3 years have passed since last update.

BQコマンドを使って既存テーブルのスキーマをベースに新しいテーブルを作る

Last updated at Posted at 2018-10-01

1. パクりたいテーブルからスキーマ情報をぶっこ抜く

bq show --project_id=プロジェクトID --schema --format=prettyjson データセット.テーブル名 > ファイル名.json

※デフォルトのプロジェクトを使う場合は--project_idの設定は不要

2. テーブルを作る

bq --project_id=プロジェクトID mk --schema ファイル名.json -t データセット.新しいテーブル名

※デフォルトのプロジェクトを使う場合は--project_idの設定は不要

5
4
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
5
4