Skip to content
Permalink
Browse files
fix: Cannot share client between appendRows and other function becaus… (
#1290)

…e appendRows needs to recreate the client to manually inject headers need for regionalization
  • Loading branch information
yirutang committed Sep 3, 2021
1 parent 8132e52 commit c2dcf6fea0e6c5ed8085269fbec884deb5f32ad0
Showing with 1 addition and 1 deletion.
  1. +1 −1 samples/snippets/src/main/java/com/example/bigquerystorage/WritePendingStream.java
@@ -65,7 +65,7 @@ public static void writePendingStream(String projectId, String datasetName, Stri
// 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 c2dcf6f

Please sign in to comment.