diff --git a/.changelog/2890.txt b/.changelog/2890.txt new file mode 100644 index 00000000000..96a087db0e8 --- /dev/null +++ b/.changelog/2890.txt @@ -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. +``` diff --git a/google/resource_bigquery_table_test.go b/google/resource_bigquery_table_test.go index 50fc9229d52..15ffa86aa64 100644 --- a/google/resource_bigquery_table_test.go +++ b/google/resource_bigquery_table_test.go @@ -267,7 +267,7 @@ resource "google_bigquery_table" "test" { time_partitioning { type = "DAY" - field = "ts" + field = "ts" } encryption_configuration { diff --git a/website/docs/r/bigquery_table.html.markdown b/website/docs/r/bigquery_table.html.markdown index f72846b2a31..ec2c9289e4d 100644 --- a/website/docs/r/bigquery_table.html.markdown +++ b/website/docs/r/bigquery_table.html.markdown @@ -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. @@ -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. @@ -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.