【问题标题】:BigQuery: Set expirationTime on a destinationTableBigQuery:在目标表上设置过期时间
【发布时间】:2016-10-28 20:05:29
【问题描述】:

我正在 BigQuery 中的大型数据集上运行 query job。作业结果存储在destinationTable 中。我希望表格在 1 天1 小时 内到期(历史数据 va. 今天的数据)。 是否可以在每个表上设置 expirationTime

我知道我可以在整个数据集上设置defaultExpirationTime,但由于我有不同的过期时间,这不是一个理想的解决方案。

【问题讨论】:

    标签: google-bigquery


    【解决方案1】:

    检查expirationTime表的属性

    expirationTime  long    [Optional] The time when this table expires, in milliseconds since 
                            the epoch. If not present, the table will persist indefinitely. 
                            Expired tables will be deleted and their storage reclaimed.
    

    您需要在创建或更新表后使用tables.patch API 进行设置(取决于您的逻辑)

    【讨论】:

    • 所以创建job的时候不能设置,但是需要在新建的表上更新expirationTime?
    • 是的,刚刚注意到。完美。
    猜你喜欢
    • 2016-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-09
    • 2020-11-07
    • 2011-12-17
    • 1970-01-01
    相关资源
    最近更新 更多