Skip to content
Permalink
Browse files
docs(sample): Remove client from JsonStreamWriter in `WriteCommit…
…tedStream` (#1248)

The sample yields a `PERMISSION_DENIED` error if we pass the `client` even if the regions are compatible and the authenticated gcloud agent/service has the required permissions.

More details on:
https://issuetracker.google.com/issues/196338290
  • Loading branch information
bphenriques committed Aug 23, 2021
1 parent 6f095db commit 6d38bd5e3ff383e55e852081bbea5807796f59dd
Showing with 1 addition and 1 deletion.
  1. +1 −1 samples/snippets/src/main/java/com/example/bigquerystorage/WriteCommittedStream.java
@@ -62,7 +62,7 @@ public static void writeCommittedStream(String projectId, String datasetName, St
// For more information about JsonStreamWriter, see:
// https://googleapis.dev/java/google-cloud-bigquerystorage/latest/com/google/cloud/bigquery/storage/v1beta2/JsonStreamWriter.html
try (JsonStreamWriter writer =
JsonStreamWriter.newBuilder(writeStream.getName(), writeStream.getTableSchema(), client)
JsonStreamWriter.newBuilder(writeStream.getName(), writeStream.getTableSchema())
.build()) {
// Append 10 JSON objects to the stream.
for (int i = 0; i < 10; i++) {

0 comments on commit 6d38bd5

Please sign in to comment.