Skip to content

Commit

Permalink
docs(sample): Remove client from JsonStreamWriter in `WriteCommit…
Browse files Browse the repository at this point in the history
…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 6d38bd5
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -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++) {
Expand Down

0 comments on commit 6d38bd5

Please sign in to comment.