table = bigquery.Table(table_id, schema=schema)
table.range_partitioning = bigquery.RangePartitioning(
# To use integer range partitioning, select a top-level REQUIRED /
# NULLABLE column with INTEGER / INT64 data type.
field="zipcode",
range_=bigquery.PartitionRange(start=0, end=100000, interval=10),
)
table = client.create_table(table) # Make an API request.
对于范围分区,您不仅需要定义字段,还需要定义范围(无论您使用的是什么语言)
从文档中:
所以在Python中,仅提供
field
是不够的,还需要为range_
提供一个对象,该对象带有PartitionRange
:有关完整示例,请查看源代码:
相关问题 更多 >
编程相关推荐