How to keep data set on BigQuery without expiration date

前端 未结 2 1295
我在风中等你
我在风中等你 2021-01-26 05:11

I recently upgraded Bigquery from sandbox mode and would like to remove data set expiration date. Could anybody share which setting I should change after the upgrade and how to

2条回答
  •  孤城傲影
    2021-01-26 05:16

    This actually has nothing to do with the Google Analytics retention settings and has everything to do with BigQuery. You can follow this guide to update the default expiration time to never:

    https://cloud.google.com/bigquery/docs/updating-datasets#table-expiration

    To update the default expiration time for newly created tables in a dataset, enter the bq update command with the --default_table_expiration flag. If you are updating a dataset in a project other than your default project, add the project ID to the dataset name in the following format: project_id:dataset.

    bq update --default_table_expiration integer project_id:dataset
    

    Replace the following:

    integer: the default lifetime, in seconds, for newly created tables. The minimum value is 3600 seconds (one hour). The expiration time evaluates to the current UTC time plus the integer value. Specify 0 to remove the existing expiration time. Any table created in the dataset is deleted integer seconds after its creation time. This value is applied if you do not set a table expiration when the table is created.

    project_id: your project ID.

    dataset: the name of the dataset that you're updating.

    Keep in mind that it only affects tables created moving forward, so come 60 days, it will look like this update doesn't work since historical tables prior to this change will start to be deleted. You can go through and change each table individually as well.

提交回复
热议问题