Skip to content

Commit 58d6d2b

Browse files
committed
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<BigQueryOptions, WriteChannelConfiguration>` as the variable type, I changed the type to this public type rather than making `TableDataWriteChannel` public.
1 parent 8ec721e commit 58d6d2b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import static com.google.common.base.Preconditions.checkArgument;
2020

21+
import com.google.cloud.BaseWriteChannel;
2122
import com.google.cloud.FieldSelector;
2223
import com.google.cloud.FieldSelector.Helper;
2324
import com.google.cloud.Page;
@@ -1027,5 +1028,6 @@ Page<List<FieldValue>> listTableData(String datasetId, String tableId,
10271028
*
10281029
* @throws BigQueryException upon failure
10291030
*/
1030-
TableDataWriteChannel writer(WriteChannelConfiguration writeChannelConfiguration);
1031+
BaseWriteChannel<BigQueryOptions, WriteChannelConfiguration> writer(
1032+
WriteChannelConfiguration writeChannelConfiguration);
10311033
}

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.google.api.services.bigquery.model.TableDataInsertAllRequest.Rows;
2525
import com.google.api.services.bigquery.model.TableRow;
2626
import com.google.cloud.BaseService;
27+
import com.google.cloud.BaseWriteChannel;
2728
import com.google.cloud.Page;
2829
import com.google.cloud.PageImpl;
2930
import com.google.cloud.PageImpl.NextPageFetcher;
@@ -670,7 +671,8 @@ private static QueryResult.Builder transformQueryResults(JobId jobId, List<Table
670671
}
671672

672673
@Override
673-
public TableDataWriteChannel writer(WriteChannelConfiguration writeChannelConfiguration) {
674+
public BaseWriteChannel<BigQueryOptions, WriteChannelConfiguration> writer(
675+
WriteChannelConfiguration writeChannelConfiguration) {
674676
return new TableDataWriteChannel(getOptions(),
675677
writeChannelConfiguration.setProjectId(getOptions().getProjectId()));
676678
}

0 commit comments

Comments
 (0)