Skip to content

Commit

Permalink
Upstream TPG #6920. (#3833) (#7012)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Aug 12, 2020
1 parent b41162b commit 05d70fe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
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

0 comments on commit 05d70fe

Please sign in to comment.