File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -356,7 +356,7 @@ func (rpr *RangePartitioningRange) toBQ() *bq.RangePartitioningRange {
356
356
}
357
357
}
358
358
359
- // Clustering governs the organization of data within a partitioned table.
359
+ // Clustering governs the organization of data within a managed table.
360
360
// For more information, see https://cloud.google.com/bigquery/docs/clustered-tables
361
361
type Clustering struct {
362
362
Fields []string
@@ -681,6 +681,10 @@ func (tm *TableMetadataToUpdate) toBQ() (*bq.Table, error) {
681
681
t .EncryptionConfiguration = tm .EncryptionConfig .toBQ ()
682
682
}
683
683
684
+ if tm .Clustering != nil {
685
+ t .Clustering = tm .Clustering .toBQ ()
686
+ }
687
+
684
688
if ! validExpiration (tm .ExpirationTime ) {
685
689
return nil , invalidTimeError (tm .ExpirationTime )
686
690
}
@@ -750,6 +754,11 @@ type TableMetadataToUpdate struct {
750
754
// When updating a schema, you can add columns but not remove them.
751
755
Schema Schema
752
756
757
+ // The table's clustering configuration.
758
+ // For more information on how modifying clustering affects the table, see:
759
+ // https://cloud.google.com/bigquery/docs/creating-clustered-tables#modifying-cluster-spec
760
+ Clustering * Clustering
761
+
753
762
// The table's encryption configuration.
754
763
EncryptionConfig * EncryptionConfig
755
764
Original file line number Diff line number Diff line change @@ -399,6 +399,12 @@ func TestTableMetadataToUpdateToBQ(t *testing.T) {
399
399
ForceSendFields : []string {"RequirePartitionFilter" },
400
400
},
401
401
},
402
+ {
403
+ tm : TableMetadataToUpdate {Clustering : & Clustering {Fields : []string {"foo" , "bar" }}},
404
+ want : & bq.Table {
405
+ Clustering : & bq.Clustering {Fields : []string {"foo" , "bar" }},
406
+ },
407
+ },
402
408
} {
403
409
got , _ := test .tm .toBQ ()
404
410
if ! testutil .Equal (got , test .want ) {
You can’t perform that action at this time.
0 commit comments