-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
google_bigquery_table shows as modified when using 'STRUCT' instead of 'RECORD' #5262
Comments
Oof! I can see the issue and how we might fix it, but honestly I'm not sure whether it is worth it if you can easily change your schema.json to use "RECORD" in your schema json. BigQuery might start returning STRUCT instead of RECORD in the future, which would eliminate the need for this, and this field is already sensitive to change, i.e. if you switched around the order of some fields so JSON is unchanged but string value changed. The fix would involve custom diff suppress to compare the JSON values (rather than just string values), which involves comparing recursive JSON schemas. For the immediate future, I can leave this open and add documentation about the workaround. |
We added documentation to schema but the actual schema diff-suppress/comparison is an issue that I'm not sure is worth fixing unless we switch client libraries. I'm going to close for now since it's a fairly old issue - if you feel this is something you strongly need, feel free to open a new issue. |
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 👉 [email protected]. Thanks! |
Community Note
Terraform Version
Affected Resource(s)
google_bigquery_table
Terraform Configuration Files
schema.json
:Expected Behavior
After applying the configuration, running
terraform plan
should show no changes need to be made.Actual Behavior
After applying the configuration, running
terraform plan
shows that the table schema needs to be updated:Steps to Reproduce
terraform apply
terraform plan
References
Both of these pages refer to
STRUCT
instead ofRECORD
:STRUCT
is an alias forRECORD
.Workaround
Use
RECORD
instead ofSTRUCT
when defining table schema.The text was updated successfully, but these errors were encountered: