@@ -87,6 +87,21 @@ underscores (_). The maximum length is 1,024 characters.`,
87
87
Elem : bigqueryDatasetAccessSchema (),
88
88
// Default schema.HashSchema is used.
89
89
},
90
+ "default_collation" : {
91
+ Type : schema .TypeString ,
92
+ Computed : true ,
93
+ Optional : true ,
94
+ Description : `Defines the default collation specification of future tables created
95
+ in the dataset. If a table is created in this dataset without table-level
96
+ default collation, then the table inherits the dataset default collation,
97
+ which is applied to the string fields that do not have explicit collation
98
+ specified. A change to this field affects only tables created afterwards,
99
+ and does not alter the existing tables.
100
+
101
+ The following values are supported:
102
+ - 'und:ci': undetermined locale, case insensitive.
103
+ - '': empty string. Default to case-sensitive behavior.` ,
104
+ },
90
105
"default_encryption_configuration" : {
91
106
Type : schema .TypeList ,
92
107
Optional : true ,
@@ -153,6 +168,14 @@ expiration time indicated by this property.`,
153
168
Optional : true ,
154
169
Description : `A descriptive name for the dataset` ,
155
170
},
171
+ "is_case_insensitive" : {
172
+ Type : schema .TypeBool ,
173
+ Computed : true ,
174
+ Optional : true ,
175
+ Description : `TRUE if the dataset and its table names are case-insensitive, otherwise FALSE.
176
+ By default, this is FALSE, which means the dataset and its table names are
177
+ case-sensitive. This field does not affect routine references.` ,
178
+ },
156
179
"labels" : {
157
180
Type : schema .TypeMap ,
158
181
Computed : true ,
@@ -445,6 +468,18 @@ func resourceBigQueryDatasetCreate(d *schema.ResourceData, meta interface{}) err
445
468
} else if v , ok := d .GetOkExists ("default_encryption_configuration" ); ! isEmptyValue (reflect .ValueOf (defaultEncryptionConfigurationProp )) && (ok || ! reflect .DeepEqual (v , defaultEncryptionConfigurationProp )) {
446
469
obj ["defaultEncryptionConfiguration" ] = defaultEncryptionConfigurationProp
447
470
}
471
+ isCaseInsensitiveProp , err := expandBigQueryDatasetIsCaseInsensitive (d .Get ("is_case_insensitive" ), d , config )
472
+ if err != nil {
473
+ return err
474
+ } else if v , ok := d .GetOkExists ("is_case_insensitive" ); ! isEmptyValue (reflect .ValueOf (isCaseInsensitiveProp )) && (ok || ! reflect .DeepEqual (v , isCaseInsensitiveProp )) {
475
+ obj ["isCaseInsensitive" ] = isCaseInsensitiveProp
476
+ }
477
+ defaultCollationProp , err := expandBigQueryDatasetDefaultCollation (d .Get ("default_collation" ), d , config )
478
+ if err != nil {
479
+ return err
480
+ } else if v , ok := d .GetOkExists ("default_collation" ); ! isEmptyValue (reflect .ValueOf (defaultCollationProp )) && (ok || ! reflect .DeepEqual (v , defaultCollationProp )) {
481
+ obj ["defaultCollation" ] = defaultCollationProp
482
+ }
448
483
449
484
url , err := replaceVars (d , config , "{{BigQueryBasePath}}projects/{{project}}/datasets" )
450
485
if err != nil {
@@ -573,6 +608,12 @@ func resourceBigQueryDatasetRead(d *schema.ResourceData, meta interface{}) error
573
608
if err := d .Set ("default_encryption_configuration" , flattenBigQueryDatasetDefaultEncryptionConfiguration (res ["defaultEncryptionConfiguration" ], d , config )); err != nil {
574
609
return fmt .Errorf ("Error reading Dataset: %s" , err )
575
610
}
611
+ if err := d .Set ("is_case_insensitive" , flattenBigQueryDatasetIsCaseInsensitive (res ["isCaseInsensitive" ], d , config )); err != nil {
612
+ return fmt .Errorf ("Error reading Dataset: %s" , err )
613
+ }
614
+ if err := d .Set ("default_collation" , flattenBigQueryDatasetDefaultCollation (res ["defaultCollation" ], d , config )); err != nil {
615
+ return fmt .Errorf ("Error reading Dataset: %s" , err )
616
+ }
576
617
if err := d .Set ("self_link" , ConvertSelfLinkToV1 (res ["selfLink" ].(string ))); err != nil {
577
618
return fmt .Errorf ("Error reading Dataset: %s" , err )
578
619
}
@@ -656,6 +697,18 @@ func resourceBigQueryDatasetUpdate(d *schema.ResourceData, meta interface{}) err
656
697
} else if v , ok := d .GetOkExists ("default_encryption_configuration" ); ! isEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , defaultEncryptionConfigurationProp )) {
657
698
obj ["defaultEncryptionConfiguration" ] = defaultEncryptionConfigurationProp
658
699
}
700
+ isCaseInsensitiveProp , err := expandBigQueryDatasetIsCaseInsensitive (d .Get ("is_case_insensitive" ), d , config )
701
+ if err != nil {
702
+ return err
703
+ } else if v , ok := d .GetOkExists ("is_case_insensitive" ); ! isEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , isCaseInsensitiveProp )) {
704
+ obj ["isCaseInsensitive" ] = isCaseInsensitiveProp
705
+ }
706
+ defaultCollationProp , err := expandBigQueryDatasetDefaultCollation (d .Get ("default_collation" ), d , config )
707
+ if err != nil {
708
+ return err
709
+ } else if v , ok := d .GetOkExists ("default_collation" ); ! isEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , defaultCollationProp )) {
710
+ obj ["defaultCollation" ] = defaultCollationProp
711
+ }
659
712
660
713
url , err := replaceVars (d , config , "{{BigQueryBasePath}}projects/{{project}}/datasets/{{dataset_id}}" )
661
714
if err != nil {
@@ -1019,6 +1072,14 @@ func flattenBigQueryDatasetDefaultEncryptionConfigurationKmsKeyName(v interface{
1019
1072
return v
1020
1073
}
1021
1074
1075
+ func flattenBigQueryDatasetIsCaseInsensitive (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
1076
+ return v
1077
+ }
1078
+
1079
+ func flattenBigQueryDatasetDefaultCollation (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
1080
+ return v
1081
+ }
1082
+
1022
1083
func expandBigQueryDatasetMaxTimeTravelHours (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
1023
1084
return v , nil
1024
1085
}
@@ -1338,3 +1399,11 @@ func expandBigQueryDatasetDefaultEncryptionConfiguration(v interface{}, d Terraf
1338
1399
func expandBigQueryDatasetDefaultEncryptionConfigurationKmsKeyName (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
1339
1400
return v , nil
1340
1401
}
1402
+
1403
+ func expandBigQueryDatasetIsCaseInsensitive (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
1404
+ return v , nil
1405
+ }
1406
+
1407
+ func expandBigQueryDatasetDefaultCollation (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
1408
+ return v , nil
1409
+ }
0 commit comments