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

Upstream TPG #6920. #7012

Merged
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
4 changes: 4 additions & 0 deletions .changelog/3833.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:bug
bigquery: fixed issue with `use_legacy_sql` not being set to `false`.

```
13 changes: 7 additions & 6 deletions google/resource_big_query_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,12 @@ Creation, truncation and append actions occur as one atomic update upon job comp
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"query": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: `SQL query text to execute. The useLegacySql field can be used to indicate whether the query uses legacy SQL or standard SQL.`,
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: `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 = ""'.`,
},
"allow_large_results": {
Type: schema.TypeBool,
Expand Down Expand Up @@ -770,7 +772,6 @@ used to populate the schema and query results of the script job. Possible values
ForceNew: true,
Description: `Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true.
If set to false, the query will use BigQuery's standard SQL.`,
Default: true,
},
"use_query_cache": {
Type: schema.TypeBool,
Expand Down Expand Up @@ -1864,7 +1865,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 {
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