From 99fa766620ece103020790770f57c639e40879ac Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Mon, 7 May 2018 17:42:32 -0700 Subject: [PATCH 1/2] bigquery: let users contruct TableResult for testing Fixes #3228. --- .../main/java/com/google/cloud/bigquery/TableResult.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java index fd5e653798d6..36a82ccad6c4 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java @@ -35,7 +35,11 @@ public class TableResult implements Page, Serializable { private final long totalRows; private final Page pageNoSchema; - TableResult(Schema schema, long totalRows, Page pageNoSchema) { + /** + * If {@code schema} is non-null, {@code TableResult} adds the schema to {@code FieldValueList}s + * when iterating through them. {@code pageNoSchema} must not be null. + */ + public TableResult(Schema schema, long totalRows, Page pageNoSchema) { this.schema = schema; this.totalRows = totalRows; this.pageNoSchema = checkNotNull(pageNoSchema); From 4ff8a55b93ff890003ea6d517c266835115e4e83 Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Tue, 8 May 2018 11:43:52 -0700 Subject: [PATCH 2/2] internal api --- .../src/main/java/com/google/cloud/bigquery/TableResult.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java index 36a82ccad6c4..a7be10d7d2ad 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java @@ -18,6 +18,7 @@ import static com.google.common.base.Preconditions.checkNotNull; +import com.google.api.core.InternalApi; import com.google.api.gax.paging.Page; import com.google.common.base.Function; import com.google.common.base.MoreObjects; @@ -39,6 +40,7 @@ public class TableResult implements Page, Serializable { * If {@code schema} is non-null, {@code TableResult} adds the schema to {@code FieldValueList}s * when iterating through them. {@code pageNoSchema} must not be null. */ + @InternalApi("Exposed for testing") public TableResult(Schema schema, long totalRows, Page pageNoSchema) { this.schema = schema; this.totalRows = totalRows;