gcloud alpha bq tables update

NAME
gcloud alpha bq tables update - update a new BigQuery table
SYNOPSIS
gcloud alpha bq tables update(TABLE :--dataset=DATASET)[--description=DESCRIPTION][--expiration=EXPIRATION][--relax-columns=[FIELD_NAME,…]][--add-columns=[FIELD_NAME=FIELD_TYPE,…]    |--add-columns-file=PATH_TO_FILE][GCLOUD_WIDE_FLAG]
DESCRIPTION
(ALPHA) Create a new BigQuery table. Updates one or more attributesof a table or view.
EXAMPLES
The following command updates the description on a table with IDmy-table inmy-dataset:
gcloudalphabqtablesupdate/projects/myproject/datasets/my-dataset/tables/my-table--description'My New Table'

The following command changes the schema mode fromREQUIRED toNULLABLE on thevalue andtags columns ina table with IDmy-other-table in datasetmy-other-dataset:

gcloudalphabqtablesupdatemy-other-table--datasetmy-other-dataset--relax-columnsname,tags
POSITIONAL ARGUMENTS
Table resource - The BigQuery table you want to update. The arguments in thisgroup can be used to specify the attributes of this resource. (NOTE) Someattributes are not given arguments in this group but can be set in other ways.

To set theproject attribute:

  • provide the argumenttable on the command line with a fullyspecified name;
  • provide the argument--project on the command line;
  • set the propertycore/project.

This must be specified.

TABLE
ID of the table or fully qualified identifier for the table.

To set thetable attribute:

  • provide the argumenttable on the command line.

This positional argument must be specified if any of the other arguments in thisgroup are specified.

--dataset=DATASET
The id of the BigQuery dataset.

To set thedataset attribute:

  • provide the argumenttable on the command line with a fullyspecified name;
  • provide the argument--dataset on the command line.
FLAGS
--description=DESCRIPTION
Description of the table.
--expiration=EXPIRATION
How long after creation should this table or view expire e.g. 1d, 2w etc.

See $gcloud topic datetimesfor information on duration formats

--relax-columns=[FIELD_NAME,…]
A comma-separated list of field names in the current schema that should havetheir mode changed from REQUIRED to NULLABLE.

For more details on updating and managing BigQuery schemas see:https://cloud.google.com/bigquery/docs/managing-table-schemas

Specify changes to the table schema.

At most one of these can be specified:

--add-columns=[FIELD_NAME=FIELD_TYPE,…]
A comma-separated list of entries of the form FIELD_NAME[=FIELD_TYPE] specifyingfield names and types for the columns being added to the table. FIELD_TYPEdefaults to string if not present. Possible FIELD_TYPES arestring,integer,float,boolean,record, andtimestamp.

For more details on BigQuery schemas see:https://cloud.google.com/bigquery/docs/schemas.

--add-columns-file=PATH_TO_FILE
The name of a JSON file containing a single object containing an array eachelement of which is an object with properties name, type, and, optionally a mode(one of:NULLABLE orREPEATED), specifying the columnsto be added to the table. If mode is omitted the default is 'NULLABLE'.

For example: { 'schema': [ { 'name': 'field1', 'type': 'string', 'mode':'REQUIRED' }, { 'name': 'field2', 'type': 'integer', 'mode': 'REPEATED' }, [ {'name': 'fieldN', 'type': TYPE, ['mode': MODE] } … ] ] }

For more details on BigQuery schemas see:https://cloud.google.com/bigquery/docs/schemas.

Use a full or relative path to a local file containing the value ofadd_columns_file.

GCLOUD WIDE FLAGS
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.

API REFERENCE
This command uses thebigquery/v2 API. The full documentation forthis API can be found at:https://cloud.google.com/bigquery/
NOTES
This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-05-07 UTC.