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

Fix google_bigquery_job to use_legacy_sql as configured in resource, add note in docs on how to run DML queries successfully #6920

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion google/resource_big_query_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -1864,7 +1864,7 @@ func expandBigQueryJobConfigurationQuery(v interface{}, d TerraformResourceData,
transformedUseLegacySql, err := expandBigQueryJobConfigurationQueryUseLegacySql(original["use_legacy_sql"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedUseLegacySql); val.IsValid() && !isEmptyValue(val) {
} else if val := reflect.ValueOf(transformedUseLegacySql); val.IsValid() {
transformed["useLegacySql"] = transformedUseLegacySql
}

Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/bigquery_job.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ The `query` block supports:
* `query` -
(Required)
SQL query text to execute. The useLegacySql field can be used to indicate whether the query uses legacy SQL or standard SQL.
*NOTE*: queries containing [DML language](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language)
(`DELETE`, `UPDATE`, `MERGE`, `INSERT`) must specify `create_disposition = ""` and `write_disposition = ""`.

* `destination_table` -
(Optional)
Expand Down