How to keep data set on BigQuery without expiration date

前端 未结 2 1294
我在风中等你
我在风中等你 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.

    0 讨论(0)
  • 2021-01-26 05:41

    In order to change the retention settings you have to change it from Google Analytics rather than inside BigQuery:

    1. Go to Google Analytics homepage and select the correct project
    2. Click on Admin which is in the bottom of the homepage
    3. On the new opened section click on Data Settings and then on Data Retention
    4. Change the Event data retention from 2 months to 14 months which is the longest retention period and click on Save

    Now you can go back to the Firebase Console and you will notice that the "Data to live" has change.

    More information about Data Retention from Google Analytics can be found here

    0 讨论(0)
提交回复
热议问题