gcloud alpha bq tables copy - copy one BigQuery table to another
gcloud alpha bq tables copy (--destination=DESTINATION : --destination-dataset=DESTINATION_DATASET) (--source=SOURCE : --source-dataset=SOURCE_DATASET) [--async] [--job-id=JOB_ID] [--overwrite] [GCLOUD_WIDE_FLAG ...]
(ALPHA) gcloud alpha bq tables copy Copies one BigQuery table to another.
The following copies table my-table to table my-other-table, in dataset my-dataset overwriting destination if it exists:
$ gcloud alpha bq tables copy --source my-table \ --destination my-other-table --source-dataset my-dataset \ --overwrite
- Table resource - The destination to copy to. The arguments in this group can be
used to specify the attributes of this resource. (NOTE) Some attributes are not given arguments in this group but can be set in other ways. To set the project attribute:
- —
provide the argument --destination on the command line with a fully specified name;
- —
provide the argument --project on the command line;
- —
set the property core/project.
This must be specified.
- --destination=DESTINATION
ID of the table or fully qualified identifier for the table. To set the source attribute:
provide the argument --destination on the command line.
This flag argument must be specified if any of the other arguments in this group are specified.
- --destination-dataset=DESTINATION_DATASET
The id of the BigQuery dataset. To set the dataset attribute:
provide the argument --destination on the command line with a fully specified name;
provide the argument --destination-dataset on the command line;
provide the argument --source-dataset on the command line.
- Table resource - The source to copy from. The arguments in this group can be
used to specify the attributes of this resource. (NOTE) Some attributes are not given arguments in this group but can be set in other ways. To set the project attribute:
- —
provide the argument --source on the command line with a fully specified name;
- —
provide the argument --project on the command line;
- —
set the property core/project.
This must be specified.
- --source=SOURCE
ID of the table or fully qualified identifier for the table. To set the source attribute:
provide the argument --source on the command line.
This flag argument must be specified if any of the other arguments in this group are specified.
- --source-dataset=SOURCE_DATASET
The id of the BigQuery dataset. To set the dataset attribute:
provide the argument --source on the command line with a fully specified name;
provide the argument --source-dataset on the command line;
provide the argument --destination-dataset on the command line.
- --async
Return immediately, without waiting for the operation in progress to complete.
- --job-id=JOB_ID
A unique job ID to use for the request. If not specified a unique job id will be generated.
- --overwrite
Overwrite if the resource already exists.
These flags are available to all commands: --access-token-file, --account, --billing-project, --configuration, --flags-file, --flatten, --format, --help, --impersonate-service-account, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity.
Run $ gcloud help for details.
This command is currently in alpha and might change without notice. If this command fails with API permission errors despite specifying the correct project, you might be trying to access an API with an invitation-only early access allowlist.