Skip to content

Feat: Adding scheduled query to Bigquery modules#454

Open
jessikad-google wants to merge 12 commits intomainfrom
jessikad/scheduled_query
Open

Feat: Adding scheduled query to Bigquery modules#454
jessikad-google wants to merge 12 commits intomainfrom
jessikad/scheduled_query

Conversation

@jessikad-google
Copy link
Copy Markdown
Contributor

@jessikad-google jessikad-google commented Jan 22, 2026

Adding a scheduled query terraform module for future usage.

@jessikad-google jessikad-google marked this pull request as ready for review January 22, 2026 16:52
@jessikad-google jessikad-google requested a review from a team as a code owner January 22, 2026 16:52
@jessikad-google jessikad-google changed the title Adding scheduled query to Bigquery modules Feat: Adding scheduled query to Bigquery modules Jan 22, 2026
@jessikad-google jessikad-google marked this pull request as draft January 22, 2026 17:19
Comment thread terraform/modules/bigquery_infra/modules/scheduled_queries/main.tf
@jessikad-google jessikad-google marked this pull request as ready for review January 22, 2026 20:15
Comment thread terraform/variables.tf
params = {
destination_table_name_template = "test_table_schedule"
write_disposition = "WRITE_APPEND"
query = "SELECT * FROM `github_metrics.events` WHERE created_at >= TIMESTAMP_SUB(@run_time, INTERVAL 24 HOUR)"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its probably safer to say create_at >= (select max(created_at) from test_table_schedule). Its less efficient more is also not going to lose data if it fails to run for more than a day.

member = each.value
}

module "scheduled_queries" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this module up one level. That will make it easier to just copy it into staging/prod. We don't use this BQ module there.

We should add "combining OSS GMA terraform with 1P terraform" to the back log.

Comment thread terraform/variables.tf
type = list(any)
default = [
{
name = "test_table_schedule"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll want this table definition in tf eventually too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants