Skip to content

Commit 2912d48

Browse files
committed
bigquery: shorten Disposition field names
In LoadConfig, shorten TableXXXDispostion to XXXDisposition. The type and doc comment suffice. Change-Id: I76045f8614818ed761a0f627ff20fd7f95618659 Reviewed-on: https://code-review.googlesource.com/8390 Reviewed-by: Michael McGreevy <[email protected]>
1 parent 2096d28 commit 2912d48

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

bigquery/load_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ func TestConfiguringLoader(t *testing.T) {
280280
want.Configuration.Load.WriteDisposition = "WRITE_TRUNCATE"
281281

282282
loader := dst.LoaderFrom(src)
283-
loader.TableCreateDisposition = CreateNever
284-
loader.TableWriteDisposition = WriteTruncate
283+
loader.CreateDisposition = CreateNever
284+
loader.WriteDisposition = WriteTruncate
285285

286286
if _, err := loader.Run(context.Background()); err != nil {
287287
t.Errorf("err calling Loader.Run: %v", err)

bigquery/table.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,13 @@ type LoadConfig struct {
327327
// Dst is the table into which the data will be loaded.
328328
Dst *Table
329329

330-
// TableCreateDisposition specifies the circumstances under which the destination table will be created.
330+
// CreateDisposition specifies the circumstances under which the destination table will be created.
331331
// The default is CreateIfNeeded.
332-
TableCreateDisposition TableCreateDisposition
332+
CreateDisposition TableCreateDisposition
333333

334-
// TableWriteDisposition specifies how existing data in the destination table is treated.
334+
// WriteDisposition specifies how existing data in the destination table is treated.
335335
// The default is WriteAppend.
336-
TableWriteDisposition TableWriteDisposition
336+
WriteDisposition TableWriteDisposition
337337
}
338338

339339
// A Loader loads data from Google Cloud Storage into a BigQuery table.
@@ -359,8 +359,8 @@ func (l *Loader) Run(ctx context.Context) (*Job, error) {
359359
job := &bq.Job{
360360
Configuration: &bq.JobConfiguration{
361361
Load: &bq.JobConfigurationLoad{
362-
CreateDisposition: string(l.TableCreateDisposition),
363-
WriteDisposition: string(l.TableWriteDisposition),
362+
CreateDisposition: string(l.CreateDisposition),
363+
WriteDisposition: string(l.WriteDisposition),
364364
},
365365
},
366366
}

0 commit comments

Comments
 (0)