mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-06 02:02:43 +00:00
Add timePartitioning.requirePartitionFilter to bigquery table (#2815)
<!-- This change is generated by MagicModules. --> /cc @rileykarson
This commit is contained in:
parent
4af5438dc2
commit
d620a648bf
|
@ -142,7 +142,7 @@ func resourceBigQueryTable() *schema.Resource {
|
||||||
ValidateFunc: validation.StringInSlice([]string{"DAY"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"DAY"}, false),
|
||||||
},
|
},
|
||||||
|
|
||||||
// Type: [Optional] The field used to determine how to create a time-based
|
// Field: [Optional] The field used to determine how to create a time-based
|
||||||
// partition. If time-based partitioning is enabled without this value, the
|
// partition. If time-based partitioning is enabled without this value, the
|
||||||
// table is partitioned based on the load time.
|
// table is partitioned based on the load time.
|
||||||
"field": {
|
"field": {
|
||||||
|
@ -150,6 +150,14 @@ func resourceBigQueryTable() *schema.Resource {
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// RequirePartitionFilter: [Optional] If set to true, queries over this table
|
||||||
|
// require a partition filter that can be used for partition elimination to be
|
||||||
|
// specified.
|
||||||
|
"require_partition_filter": {
|
||||||
|
Type: schema.TypeBool,
|
||||||
|
Optional: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -436,6 +444,10 @@ func expandTimePartitioning(configured interface{}) *bigquery.TimePartitioning {
|
||||||
tp.ExpirationMs = int64(v.(int))
|
tp.ExpirationMs = int64(v.(int))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if v, ok := raw["require_partition_filter"]; ok {
|
||||||
|
tp.RequirePartitionFilter = v.(bool)
|
||||||
|
}
|
||||||
|
|
||||||
return tp
|
return tp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -450,6 +462,10 @@ func flattenTimePartitioning(tp *bigquery.TimePartitioning) []map[string]interfa
|
||||||
result["expiration_ms"] = tp.ExpirationMs
|
result["expiration_ms"] = tp.ExpirationMs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if tp.RequirePartitionFilter == true {
|
||||||
|
result["require_partition_filter"] = tp.RequirePartitionFilter
|
||||||
|
}
|
||||||
|
|
||||||
return []map[string]interface{}{result}
|
return []map[string]interface{}{result}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,7 @@ resource "google_bigquery_table" "test" {
|
||||||
time_partitioning {
|
time_partitioning {
|
||||||
type = "DAY"
|
type = "DAY"
|
||||||
field = "ts"
|
field = "ts"
|
||||||
|
require_partition_filter = true
|
||||||
}
|
}
|
||||||
|
|
||||||
schema = <<EOH
|
schema = <<EOH
|
||||||
|
|
|
@ -88,6 +88,10 @@ The `time_partitioning` block supports:
|
||||||
* `type` - (Required) The only type supported is DAY, which will generate
|
* `type` - (Required) The only type supported is DAY, which will generate
|
||||||
one partition per day based on data loading time.
|
one partition per day based on data loading time.
|
||||||
|
|
||||||
|
* `require_partition_filter` - (Optional) If set to true, queries over this table
|
||||||
|
require a partition filter that can be used for partition elimination to be
|
||||||
|
specified.
|
||||||
|
|
||||||
The `view` block supports:
|
The `view` block supports:
|
||||||
|
|
||||||
* `query` - (Required) A query that BigQuery executes when the view is referenced.
|
* `query` - (Required) A query that BigQuery executes when the view is referenced.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user