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

google_bigquery_job wait for job complete #9826

Open
YuriiYashchenko opened this issue Aug 17, 2021 · 0 comments
Open

google_bigquery_job wait for job complete #9826

YuriiYashchenko opened this issue Aug 17, 2021 · 0 comments

Comments

@YuriiYashchenko
Copy link

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

google_bigquery_job resource can create a long-running job, for example, BQ script. After the job is triggered, Terraform doesn't wait until it is completed and marks the resource as successfully created. There is no way to know when is it's safe to use results. If some other resource depends on the job results, there is an issue with describing this dependency without using a workaround such as additional time_sleep resource. It would be nice to have an option like wait_for_job_complete to wait for DONE state.

New or Affected Resource(s)

  • google_bigquery_job

Potential Terraform Configuration

resource "google_bigquery_job" "item_recreate_job" {
  project  = var.project_id
  location = var.location
  job_id   = format("Item_%s", uuid())
  query {
    query          = <<EOF
     #standardSQL 
    select * 
    FROM dwh.Item_view
EOF
    use_legacy_sql = false
    destination_table {
      project_id = var.project_id
      dataset_id = google_bigquery_dataset.bi_star.dataset_id
      table_id   = "Item"
    }
    write_disposition = "WRITE_TRUNCATE"
  }
  wait_for_job_complete=true
}

References

  • #0000
@slevenick slevenick added this to the Backlog milestone Aug 23, 2021
@github-actions github-actions bot added service/bigquery forward/review In review; remove label to forward labels Aug 17, 2023
@roaks3 roaks3 added forward/exempt Never forward this issue and removed forward/review In review; remove label to forward labels Oct 2, 2023
modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Jan 17, 2024
)

[upstream:efa00d8ce33064be98735ccda0b0513010e0e9d8]

Signed-off-by: Modular Magician <[email protected]>
modular-magician added a commit that referenced this issue Jan 17, 2024
)

[upstream:efa00d8ce33064be98735ccda0b0513010e0e9d8]

Signed-off-by: Modular Magician <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants