From 288c5a2476f61079f226c2f2c21390489dbab4a6 Mon Sep 17 00:00:00 2001 From: Adler Santos Date: Mon, 12 Jul 2021 00:43:32 -0400 Subject: [PATCH] feat: Support partitioning, clustering, and protection properties for BQ tables (#116) * feat: modify BQ table template to use partitioning and clustering * added BQ table optional properties on pipeline.yaml sample * added deletion_protection property for BQ tables * tests for new optional BQ table properties * fix: partition Google Trends tables (#118) --- .../_terraform/top_terms_pipeline.tf | 80 +++++++++++++++++++ .../google_trends/top_terms/pipeline.yaml | 70 ++++++++++++++++ samples/pipeline.yaml | 22 +++++ .../terraform/google_bigquery_table.tf.jinja2 | 13 +++ tests/scripts/test_generate_terraform.py | 20 ++++- 5 files changed, 201 insertions(+), 4 deletions(-) diff --git a/datasets/google_trends/_terraform/top_terms_pipeline.tf b/datasets/google_trends/_terraform/top_terms_pipeline.tf index 61029dd55..5560b317f 100644 --- a/datasets/google_trends/_terraform/top_terms_pipeline.tf +++ b/datasets/google_trends/_terraform/top_terms_pipeline.tf @@ -21,7 +21,47 @@ resource "google_bigquery_table" "top_terms" { table_id = "top_terms" description = "Daily top 25 terms in the United States with score, ranking, time, and designated market area" + time_partitioning { + type = "DAY" + field = "refresh_date" + + require_partition_filter = false + } + + + schema = <