20 Sep 21 ·  mCollins in Bigquery ·        Bookmark ·  Report ·  More actions.. Lock comments ·  Pin thread

Bigquery bq cp examples

Use the "cp" command to copy tables, create table snapshots, or restore table snapshots

bq cp myDataset.SourceTable myDataset.BackupTable

To copy across projects

bq cp project:myDataset.SourceTable project:myDataset.BackupTable

Time Travel copy

bq cp myDataset.myTable@1632170743 myDataset.myTableClone

To overwrite the target table

bq cp --force=true myDataset.SourceTable myDataset.BackupTable

To create a snapshot backup table

bq cp --snapshot myDataset.SourceTable myDataset.BackupTable

Optional Arguments:

  • --append_table={true|false} or -a={true|false}
  • --destination_kms_key=KEY
  • --expiration=SECONDS
  • --force={true|false} or -f={true|false}
  • --no_clobber={true|false} or -n={true|false}
  • --restore
  • --snapshot

mCollins

posted on 20 Sep 21

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds