Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to create BigQuery Materialized View if require_partition_filter is true #21691

Open
ojikeii opened this issue Mar 4, 2025 · 0 comments
Labels
bug forward/review In review; remove label to forward service/bigquery

Comments

@ojikeii
Copy link

ojikeii commented Mar 4, 2025

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version & Provider Version(s)

Terraform v1.9.7
on linux_amd64

  • provider registry.terraform.io/hashicorp/google v6.23.0
  • provider registry.terraform.io/hashicorp/google-beta v6.23.0

Affected Resource(s)

google_bigquery_table

Terraform Configuration

resource "google_bigquery_table" "test" {
  dataset_id = google_bigquery_dataset.<dataset>.dataset_id
  table_id   = "test"

  time_partitioning {
    type  = "DAY"
    field = "timestamp"
  }

  materialized_view {
    query               = <<QUERY
select timestamp from `<project>.<dataset>.<table>`
QUERY
    enable_refresh      = false
  }

  require_partition_filter = true
}

Debug Output

No response

Expected Behavior

The materialized view is created successfully.

Actual Behavior

The error below occurred.

Error: googleapi: Error 400: Materialized views cannot require a partition filter., invalid

After require_partition_filter is false, the materialzied view is created successfully.
Once the materialized view is created with false, require_partition_filter can be set to true.

Steps to reproduce

  1. terraform apply
  2. set require_partition_filter to false
  3. terraform apply -> created successfully
  4. set require_partition_filter to true
  5. terraform apply -> updated successfully

Important Factoids

No response

References

No response

@ojikeii ojikeii added the bug label Mar 4, 2025
@github-actions github-actions bot added forward/review In review; remove label to forward service/bigquery labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug forward/review In review; remove label to forward service/bigquery
Projects
None yet
Development

No branches or pull requests

1 participant