From 24fc00e06c402792dd190663c643294a239a45bb Mon Sep 17 00:00:00 2001 From: Pei He Date: Thu, 7 Apr 2016 16:06:31 -0700 Subject: [PATCH] Addressed review comments --- .../java/com/google/cloud/dataflow/sdk/io/BigQueryIO.java | 8 ++++---- .../cloud/dataflow/sdk/util/BigQueryServicesImpl.java | 1 - .../com/google/cloud/dataflow/sdk/io/BigQueryIOTest.java | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/io/BigQueryIO.java b/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/io/BigQueryIO.java index 6a3bc594149f1..4e402a5a19511 100644 --- a/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/io/BigQueryIO.java +++ b/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/io/BigQueryIO.java @@ -788,14 +788,14 @@ public Bound() { private Bound(String name, @Nullable String jsonTableRef, @Nullable SerializableFunction tableRefFunction, @Nullable String jsonSchema, - CreateDisposition createDisposition, WriteDisposition writeDisposition, - boolean validate, BigQueryServices testBigQueryServices) { + CreateDisposition createDisposition, WriteDisposition writeDisposition, boolean validate, + @Nullable BigQueryServices testBigQueryServices) { super(name); this.jsonTableRef = jsonTableRef; this.tableRefFunction = tableRefFunction; this.jsonSchema = jsonSchema; - this.createDisposition = createDisposition; - this.writeDisposition = writeDisposition; + this.createDisposition = checkNotNull(createDisposition, "createDisposition"); + this.writeDisposition = checkNotNull(writeDisposition, "writeDisposition"); this.validate = validate; this.testBigQueryServices = testBigQueryServices; } diff --git a/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/util/BigQueryServicesImpl.java b/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/util/BigQueryServicesImpl.java index 25eb6aa9d788d..f0c886488a108 100644 --- a/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/util/BigQueryServicesImpl.java +++ b/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/util/BigQueryServicesImpl.java @@ -31,7 +31,6 @@ import com.google.cloud.dataflow.sdk.options.BigQueryOptions; import com.google.cloud.hadoop.util.ApiErrorExtractor; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Throwables; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/io/BigQueryIOTest.java b/sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/io/BigQueryIOTest.java index 691a33c9bb05b..e26e25a152836 100644 --- a/sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/io/BigQueryIOTest.java +++ b/sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/io/BigQueryIOTest.java @@ -38,8 +38,8 @@ import com.google.cloud.dataflow.sdk.transforms.Create; import com.google.cloud.dataflow.sdk.util.BigQueryServices; import com.google.cloud.dataflow.sdk.util.BigQueryServices.Status; -import com.google.common.collect.ImmutableList; import com.google.cloud.dataflow.sdk.util.CoderUtils; +import com.google.common.collect.ImmutableList; import org.hamcrest.Matchers; import org.junit.Assert; @@ -196,7 +196,7 @@ private void checkWriteObjectWithValidate( assertEquals(project, bound.getTable().getProjectId()); assertEquals(dataset, bound.getTable().getDatasetId()); assertEquals(table, bound.getTable().getTableId()); - assertEquals(schema, bound.jsonSchema); + assertEquals(schema, bound.getSchema()); assertEquals(createDisposition, bound.createDisposition); assertEquals(writeDisposition, bound.writeDisposition); assertEquals(validate, bound.validate);