Skip to content

Commit

Permalink
sample: update WriteCommittedStream.java (#2047)
Browse files Browse the repository at this point in the history
Fixes #2046

This change allows streamWriter to use BiqQuery Client passed to initialize method and not creating another copy of BigQuery client.
  • Loading branch information
OleksiyIvanov authored Apr 17, 2023
1 parent ad6b03a commit 4fc8286
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ void initialize(TableName parentTable, BigQueryWriteClient client)
// For more information about JsonStreamWriter, see:
// https://googleapis.dev/java/google-cloud-bigquerystorage/latest/com/google/cloud/bigquery/storage/v1/JsonStreamWriter.html
streamWriter =
JsonStreamWriter.newBuilder(writeStream.getName(), writeStream.getTableSchema()).build();
JsonStreamWriter.newBuilder(writeStream.getName(), writeStream.getTableSchema(), client)
.build();
}

public void append(JSONArray data, long offset)
Expand Down

0 comments on commit 4fc8286

Please sign in to comment.