Skip to content

Commit

Permalink
bigquery: shorten Disposition field names
Browse files Browse the repository at this point in the history
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 <mcgreevy@golang.org>
  • Loading branch information
jba committed Oct 13, 2016
1 parent 2096d28 commit 2912d48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions bigquery/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ func TestConfiguringLoader(t *testing.T) {
want.Configuration.Load.WriteDisposition = "WRITE_TRUNCATE"

loader := dst.LoaderFrom(src)
loader.TableCreateDisposition = CreateNever
loader.TableWriteDisposition = WriteTruncate
loader.CreateDisposition = CreateNever
loader.WriteDisposition = WriteTruncate

if _, err := loader.Run(context.Background()); err != nil {
t.Errorf("err calling Loader.Run: %v", err)
Expand Down
12 changes: 6 additions & 6 deletions bigquery/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,13 @@ type LoadConfig struct {
// Dst is the table into which the data will be loaded.
Dst *Table

// TableCreateDisposition specifies the circumstances under which the destination table will be created.
// CreateDisposition specifies the circumstances under which the destination table will be created.
// The default is CreateIfNeeded.
TableCreateDisposition TableCreateDisposition
CreateDisposition TableCreateDisposition

// TableWriteDisposition specifies how existing data in the destination table is treated.
// WriteDisposition specifies how existing data in the destination table is treated.
// The default is WriteAppend.
TableWriteDisposition TableWriteDisposition
WriteDisposition TableWriteDisposition
}

// A Loader loads data from Google Cloud Storage into a BigQuery table.
Expand All @@ -359,8 +359,8 @@ func (l *Loader) Run(ctx context.Context) (*Job, error) {
job := &bq.Job{
Configuration: &bq.JobConfiguration{
Load: &bq.JobConfigurationLoad{
CreateDisposition: string(l.TableCreateDisposition),
WriteDisposition: string(l.TableWriteDisposition),
CreateDisposition: string(l.CreateDisposition),
WriteDisposition: string(l.WriteDisposition),
},
},
}
Expand Down

0 comments on commit 2912d48

Please sign in to comment.