Skip to content

Commit

Permalink
bigquery: let users contruct TableResult for testing (#3242)
Browse files Browse the repository at this point in the history
Fixes #3228.
  • Loading branch information
pongad committed May 8, 2018
1 parent 40a0012 commit 4b6e1cb
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -35,7 +36,12 @@ public class TableResult implements Page<FieldValueList>, Serializable {
private final long totalRows;
private final Page<FieldValueList> pageNoSchema;

TableResult(Schema schema, long totalRows, Page<FieldValueList> 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.
*/
@InternalApi("Exposed for testing")
public TableResult(Schema schema, long totalRows, Page<FieldValueList> pageNoSchema) {
this.schema = schema;
this.totalRows = totalRows;
this.pageNoSchema = checkNotNull(pageNoSchema);
Expand Down

0 comments on commit 4b6e1cb

Please sign in to comment.