Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for range partitioning in BigQuery #5723

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/2890.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
Support for range-based partitioning in BigQuery tables has landed. Fixes https://github.com/terraform-providers/terraform-provider-google/issues/5239.
```
2 changes: 1 addition & 1 deletion google/resource_bigquery_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ resource "google_bigquery_table" "test" {

time_partitioning {
type = "DAY"
field = "ts"
field = "ts"
}

encryption_configuration {
Expand Down
21 changes: 20 additions & 1 deletion website/docs/r/bigquery_table.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ The following arguments are supported:
* `time_partitioning` - (Optional) If specified, configures time-based
partitioning for this table. Structure is documented below.

* `range_partitioning` - (Optional, Beta) If specified, configures range-based
partitioning for this table. Structure is documented below.

* `clustering` - (Optional) Specifies column names to use for data clustering.
Up to four top-level columns are allowed, and should be specified in
descending priority order.
Expand Down Expand Up @@ -176,7 +179,7 @@ The `csv_options` block supports:
characters, you must also set the `allow_quoted_newlines` property to true.
The API-side default is `"`, specified in Terraform escaped as `\"`. Due to
limitations with Terraform default values, this value is required to be
explicitly set.
explicitly set.

* `allow_jagged_rows` (Optional) - Indicates if BigQuery should accept rows
that are missing trailing optional columns.
Expand Down Expand Up @@ -220,6 +223,22 @@ The `time_partitioning` block supports:
require a partition filter that can be used for partition elimination to be
specified.

The `range_partitioning` block supports:

* `field` - (Required) The field used to determine how to create a range-based
partition.

* `range` - (Required) Information required to partition based on ranges.
Structure is documented below.

The `range` block supports:

* `start` - (Required) Start of the range partitioning, inclusive.

* `end` - (Required) End of the range partitioning, exclusive.

* `interval` - (Required) The width of each range within the partition.

The `view` block supports:

* `query` - (Required) A query that BigQuery executes when the view is referenced.
Expand Down