Skip to content

Commit 4fc8286

Browse files
sample: update WriteCommittedStream.java (#2047)
Fixes #2046 This change allows streamWriter to use BiqQuery Client passed to initialize method and not creating another copy of BigQuery client.
1 parent ad6b03a commit 4fc8286

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

samples/snippets/src/main/java/com/example/bigquerystorage/WriteCommittedStream.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ void initialize(TableName parentTable, BigQueryWriteClient client)
117117
// For more information about JsonStreamWriter, see:
118118
// https://googleapis.dev/java/google-cloud-bigquerystorage/latest/com/google/cloud/bigquery/storage/v1/JsonStreamWriter.html
119119
streamWriter =
120-
JsonStreamWriter.newBuilder(writeStream.getName(), writeStream.getTableSchema()).build();
120+
JsonStreamWriter.newBuilder(writeStream.getName(), writeStream.getTableSchema(), client)
121+
.build();
121122
}
122123

123124
public void append(JSONArray data, long offset)

0 commit comments

Comments
 (0)