Skip to content

Commit

Permalink
fix: Cannot share client between appendRows and other function becaus… (
Browse files Browse the repository at this point in the history
#1290)

…e appendRows needs to recreate the client to manually inject headers need for regionalization
  • Loading branch information
yirutang authored Sep 3, 2021
1 parent 8132e52 commit c2dcf6f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit c2dcf6f

Please sign in to comment.