From 58d6d2bbb4badaa515faa17c73bfead5545078f0 Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Fri, 11 Nov 2016 12:55:41 -0800 Subject: [PATCH] bigquery: BigQuery.writer return type should be public. The `BigQuery.writer` function does not link to its return type in the javadocs. http://googlecloudplatform.github.io/google-cloud-java/0.5.1/apidocs/com/google/cloud/bigquery/BigQuery.html#writer(com.google.cloud.bigquery.WriteChannelConfiguration) I believe this is because `TableDataWriteChannel` is package-private. Since the snippets use `BaseWriteChannel` as the variable type, I changed the type to this public type rather than making `TableDataWriteChannel` public. --- .../src/main/java/com/google/cloud/bigquery/BigQuery.java | 4 +++- .../src/main/java/com/google/cloud/bigquery/BigQueryImpl.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index 47a30cfd32aa..d476db75c3dd 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -18,6 +18,7 @@ import static com.google.common.base.Preconditions.checkArgument; +import com.google.cloud.BaseWriteChannel; import com.google.cloud.FieldSelector; import com.google.cloud.FieldSelector.Helper; import com.google.cloud.Page; @@ -1027,5 +1028,6 @@ Page> listTableData(String datasetId, String tableId, * * @throws BigQueryException upon failure */ - TableDataWriteChannel writer(WriteChannelConfiguration writeChannelConfiguration); + BaseWriteChannel writer( + WriteChannelConfiguration writeChannelConfiguration); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 238db6c79fb2..5ed8e39b4dd9 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -24,6 +24,7 @@ import com.google.api.services.bigquery.model.TableDataInsertAllRequest.Rows; import com.google.api.services.bigquery.model.TableRow; import com.google.cloud.BaseService; +import com.google.cloud.BaseWriteChannel; import com.google.cloud.Page; import com.google.cloud.PageImpl; import com.google.cloud.PageImpl.NextPageFetcher; @@ -670,7 +671,8 @@ private static QueryResult.Builder transformQueryResults(JobId jobId, List writer( + WriteChannelConfiguration writeChannelConfiguration) { return new TableDataWriteChannel(getOptions(), writeChannelConfiguration.setProjectId(getOptions().getProjectId())); }