如何在BQ命令行中设置大查询需要分区过滤器

osm*_*mos 4 google-bigquery

在Big Query Web GUI中创建新的空分区表模式时,可以设置Require Partition过滤器选项.

使用bq命令行工具创建表时,如何设置相同的选项.现在我的命令是:

bq mk --table --time_partitioning_field event_time my_dataset.events event_id:INTEGER,event_time:TIMESTAMP
Run Code Online (Sandbox Code Playgroud)

该命令成功创建了分区表,但我没有看到用于设置Require Partition过滤器的标志.

如何在创建表后稍后编辑选项?

ken*_*000 6

回答你的第二个问题:

bq update --require_partition_filter --time_partitioning_field=event_time my_dataset.events
Run Code Online (Sandbox Code Playgroud)

或者使用完全限定的表名:

bq update --require_partition_filter --time_partitioning_field=event_time project-id:my_dataset.events
Run Code Online (Sandbox Code Playgroud)

您还可以禁用:

bq update --norequire_partition_filter --time_partitioning_field=event_time project-id:my_dataset.events
Run Code Online (Sandbox Code Playgroud)


Pav*_*ara 5

如果您使用的是bq命令行版本> = 2.0.30,则应在mk命令中看到--require_partition_filter选项.如果不是这样,请告诉我们.谢谢!