Skip to content

Commit

Permalink
feat: add support for require_partition_filter in the external tables
Browse files Browse the repository at this point in the history
  • Loading branch information
NitriKx committed Aug 8, 2024
1 parent b5b938e commit 171c433
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion examples/multiple_tables/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ module "bigquery" {
]
csv_options = null
hive_partitioning_options = {
mode = "AUTO"
mode = "AUTO"
require_partition_filter = true
# DO NOT CHANGE - see above source_uris
source_uri_prefix = "gs://ci-bq-external-data/hive_partition_example/"
}
Expand Down
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ resource "google_bigquery_table" "external_table" {
dynamic "hive_partitioning_options" {
for_each = each.value["hive_partitioning_options"] != null ? [each.value["hive_partitioning_options"]] : []
content {
mode = hive_partitioning_options.value["mode"]
source_uri_prefix = hive_partitioning_options.value["source_uri_prefix"]
mode = hive_partitioning_options.value["mode"]
source_uri_prefix = hive_partitioning_options.value["source_uri_prefix"]
require_partition_filter = hive_partitioning_options.value["require_partition_filter"]
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,9 @@ variable "external_tables" {
skip_leading_rows = number,
}),
hive_partitioning_options = object({
mode = string,
source_uri_prefix = string,
mode = string,
source_uri_prefix = string,
require_partition_filter = optional(bool),
}),
expiration_time = string,
max_staleness = optional(string),
Expand Down

0 comments on commit 171c433

Please sign in to comment.