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

Schema update for bigquery table #6931

Closed
alexandre-cruel opened this issue Aug 4, 2020 · 5 comments
Closed

Schema update for bigquery table #6931

alexandre-cruel opened this issue Aug 4, 2020 · 5 comments
Assignees

Comments

@alexandre-cruel
Copy link

alexandre-cruel commented Aug 4, 2020

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 the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

I'd like to create bigquery tables via terraform.
The tables I plan to create are partitionned tables (i.e. requires a schema by default).
This schema will potentially change in the future if I need to add some columns to my table.
The data stored in the table isnt easy to reload and shouldnt be erased in production.
Though it looks like updating the schema will completely recreate the table as mentionned here.

From what google says here : it's not possible to do such thing.
I think this feature would really help creating the tables by IaC while being stil dynamic in there use.
Thank you for the help and clarification

New or Affected Resource(s)

  • google_bigquery_table

References

@ghost ghost added enhancement labels Aug 4, 2020
@c2thorn c2thorn self-assigned this Aug 10, 2020
@c2thorn
Copy link
Collaborator

c2thorn commented Aug 12, 2020

Hi @alexandre-cruel, just wanted to get some clarification. There are two schema fields in the resource. The external_data_configuration.schema field you linked to is within the external_data_configuration block, and looks like it is only used during table creation.

However there is the standard schema field here that is updatable without destroying the table. Is this suitable for you?

@alexandre-cruel
Copy link
Author

In the use case I'm working on this isnt for external_data_configuration, it was for tables with data directly living on bigquery but according to the documentation I thaught it was the same for the 2 schema parameters.

Totally suitable yes, if you're sure that updating the schema to add a column wont delete the table and erase the dat, that'd be perfect 👍 !

@ghost ghost removed the waiting-response label Aug 17, 2020
@c2thorn
Copy link
Collaborator

c2thorn commented Aug 17, 2020

That makes sense! It can be slightly confusing, and we are working on a UI update that should hopefully make it easier to differentiate between the two schema parameters.

I cannot guarantee how the API will behave when the provider calls update, but I can say that Terraform will not try to destroy/recreate the table while updating the top-level schema field. To fully make sure, I recommend testing out your scenario first. If the provider is behaving differently than expected, feel free to comment here!

@c2thorn c2thorn closed this as completed Aug 17, 2020
@alexandre-cruel
Copy link
Author

Great, thank you for your investigation time and help !

@ghost
Copy link

ghost commented Sep 17, 2020

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 and limited conversation to collaborators Sep 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants