是否仍然可以从BigQuery表中删除“分区过滤器” =“必需”设置?

时间:2020-04-15 22:10:24

标签: google-bigquery

我尝试删除对BigQuery分区表中的分区列进行过滤的要求。 The answer presented here似乎不起作用:查询运行,显示结果

"This statement altered the table named project:dataset.table"

甚至还有一个按钮可以转到表,但是它仍然需要分区过滤器。

编辑:包括表配置和使用的查询

Data location: US 
Table type: Partitioned 
Partitioned by: Day 
Partitioned on field: date 
Partition filter :Required
Clustered by: column_name1, column_name2, column_name3

我完全按照答案中的说明尝试了两个查询:

ALTER TABLE IF EXISTS dataset.table
SET OPTIONS(
    require_partition_filter = false
)

还有

ALTER TABLE dataset.table
SET OPTIONS(
    require_partition_filter = false
)

例如,对于第二个查询,我的查询历史记录中包含以下信息:

查询成功

Query completed in 0.159 sec
Job ID: job_id 
User: user
Location: United States (US)
Creation time: creation_time
Start time: start_time
End time: end_time
Duration: 0.2 sec 
Bytes processed: 0 B 
Bytes billed :0 B 
Job priority: INTERACTIVE 
Destination table: project:dataset.table
Write preference:
Use legacy SQL: false

“项目”,“数据集”,“表”,“ job_id”,“用户”,“创建时间”,“开始时间”,“结束时间”已被替换

有帮助吗?

1 个答案:

答案 0 :(得分:0)

为了进一步为社区做出贡献,此答案基于我的最后评论。

根据documentation,虽然 ALTER 命令应该起作用。还有另一个更新数据集,表,视图或模型的选项,即bq update命令。

此命令中包含各种标志,包括 require_partition_filter norequire_partition_filter ,以便设置分区过滤器分别为True或False。您可以按照以下方式使用此命令:

bq update --norequire_partition_filter --time_partitioning_field=your_partition_field project:dataset.table

提交命令后,您应该收到以下消息:

Table 'project_id_dataset_table_name' successfully updated.

因此,您的表不再需要在分区列上进行过滤。

相关问题