【问题标题】:GCP BigQueryOperator table expirationGCP BigQueryOperator 表过期
【发布时间】:2020-03-28 22:11:59
【问题描述】:

使用查询创建表时,如何在 Airflow 中使用 BigQueryOperator 设置表过期时间。 我们可以使用另一个 BigQueryOperator 更新表的过期时间,但要同时寻找创建和设置过期时间。

【问题讨论】:

  • 你想在表上还是在分区上设置过期时间?

标签: google-cloud-platform google-bigquery airflow


【解决方案1】:

在您的 SQL 中使用 DDL 语句,如下所示:

CREATE TABLE
  dataset.foo OPTIONS( expiration_timestamp=TIMESTAMP "2020-01-01 00:00:00 UTC",
    description="A table created from SQL with a expiration set" ) AS
SELECT
  'foo' AS col_1

【讨论】:

    猜你喜欢
    • 2018-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-18
    • 2019-07-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多