BigQuery Alter table set options
Sets options on BigQuery table
Alter table set options example
\n ALTER TABLE mydataset.mypartitionedtable\n SET OPTIONS (require_partition_filter=true)\n\n\n
Example 2: Set table expiration timestamp and description
\n\n ALTER TABLE mydataset.mytable\n SET OPTIONS (\n expiration_timestamp=TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY),\n description="Table that expires seven days from now"\n )\n\n\n
Example 3: Removing expiration timestamp
\n\n ALTER TABLE mydataset.mytable\n SET OPTIONS (expiration_timestamp=NULL)\n
Explanation
table_set_options_list options
\nOption | \n VALUE | \n Explnation | \n
---|---|---|
default_ | \n STRING | \n Specifies the default Cloud KMS key for encrypting table data\n in this dataset. You can override this value when you create a table. | \n
default_ | \n FLOAT64 | \n Specifies the default expiration time, in days, for table partitions in\n this dataset. You can override this value when you create a table. | \n
default_ | \n FLOAT64 | \n Specifies the default expiration time, in days, for tables in this\n dataset. You can override this value when you create a table. | \n
description | \n STRING | \n The description of the dataset. | \n
friendly_ | \n STRING | \n A descriptive name for the dataset. | \n
labels | \n <ARRAY<STRUCT<STRING, | \n An array of labels for the dataset, expressed as key-value pairs. | \n
location | \n STRING | \n The location in which to create the dataset. If you don't specify this\n option, the dataset is created in the location where the query runs. If\n you specify this option and also explicitly set the location for the query\n job, the two values must match; otherwise the query fails. | \n
Syntax reference
ALTER TABLE [IF EXISTS] [[project_name.]dataset_name.]table_name\nSET OPTIONS(table_set_options_list)