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

Terrafrom recreates bigquery table on schema updates while bq cli updates properly #8710

Closed
Assignees
Labels
bug forward/review In review; remove label to forward service/bigquery

Comments

@milosbackonja
Copy link

milosbackonja commented Mar 17, 2021

Terraform Version

Terraform v0.14.8
provider registry.terraform.io/hashicorp/google v3.60.0

Affected Resource(s)

google_bigquery_table

Terraform Configuration Files

resource "google_bigquery_dataset" "default" {
  dataset_id                  = "foo"
  friendly_name               = "test"
  description                 = "This is a test description"
  location                    = "EU"
  default_table_expiration_ms = 3600000

  labels = {
    env = "default"
  }
}

resource "google_bigquery_table" "default" {
  dataset_id = google_bigquery_dataset.default.dataset_id
  table_id   = "bar"

  time_partitioning {
    type = "DAY"
  }

  labels = {
    env = "default"
  }

  schema = <<EOF
[
  {
    "name": "permalink",
    "type": "STRING",
    "mode": "NULLABLE",
    "description": "The Permalink"
  },
  {
    "name": "state",
    "type": "STRING",
    "mode": "NULLABLE",
    "description": "State where the head office is located"
  }
]
EOF

}

Debug Output

Panic Output

Expected Behavior

It should update resource and schema since bq cli does it without problem with same change

Actual Behavior

It forces resource replacement

Steps to Reproduce

  1. Update schema

  2. terraform apply

Important Factoids

References

#8630

@ghost ghost added the bug label Mar 17, 2021
@venkykuberan
Copy link
Contributor

Looks like the fix applied for @#8337 isn't covering this case probably. @c2thorn any thoughts ?

@c2thorn
Copy link
Collaborator

c2thorn commented Mar 18, 2021

Looks like the fix applied for @#8337 isn't covering this case probably. @c2thorn any thoughts ?

That seemed to have covered a specific use case. This seems to be about updates in general? Is this not a duplicate of #8630

@milosbackonja
Copy link
Author

Thing is that in the past with older provider versions I was able to update schema, so it cant be threated as enhancement/feature, its a bug. In #8630 its asked for new feature since whoever posted that didn't know that it was working before...

@c2thorn
Copy link
Collaborator

c2thorn commented Mar 18, 2021

@milosbackonja I see, are referring specifically to adding a nullable column? Essentially reopening #8503 ?

@milosbackonja
Copy link
Author

@c2thorn For me its happening even if I add required, nullable or repeated column.

@jacques-
Copy link

Same here, no matter what options I select for new column

@ghost
Copy link

ghost commented Apr 30, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 30, 2021
@github-actions github-actions bot added service/bigquery forward/review In review; remove label to forward labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.