为什么在 BigQuery 沙盒环境中会发生这种情况? - 它只在 BigQuery 中创建空的分区表

Why is this happening in BigQuery Sandbox Environment ? - it only creates empty partitioned tables in BigQuery

我也一样,不知何故当 运行 在 DDL 语句下面创建分区 Table - 它正在创建空的分区 Tables,不知道为什么!! -- 这发生在 BigQuery 沙盒环境中。

有人能告诉我为什么会这样吗?

CREATE OR REPLACE TABLE 
stack_it.questions_2018_clustered 
PARTITION BY DATE(creation_date) 
CLUSTER BY tags 
AS 
SELECT id, title, accepted_answer_id, creation_date, answer_count, comment_count, favorite_count, view_count, tags 
FROM 
bigquery-public-data.Whosebug.posts_questions 
WHERE creation_date BETWEEN '2018-01-01' AND '2019-01-01';

如此 documentation 中所述,在 BigQuery 沙盒环境中,tables 和分区在 60 天后过期,除非从沙盒升级,否则无法增加此限制。空分区的原因 table 是这个 60 天的限制。

分区到期日期是根据分区时间为每个分区独立计算的。由于新 table 是使用超过 60 天的日期(2018 年、2019 年)创建的,因此将删除具有这些日期的任何分区。我通过创建具有最近日期(60 天内)的 table 来测试此行为,并且新分区 table 已按预期填充数据。有关分区到期的更多信息,请参阅 here.

要移除 BigQuery Sandbox 限制,我建议您升级您的项目。从沙盒升级后,您仍然可以使用 free tier, but you can generate charges. To manage BigQuery quotas, consider setting up cost controls. More info on upgrading from Sandbox and updating the expiration periods can be found here.