Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit eec50c1

Browse files
authored
feat: always pass a null bigquery client lib to StreamWriter (#1795)
In order for regional routing to work, right now, we need to recreate a BigQueryWriteClient with custom header on StreamWriter. The new JsonWriter builder interface we added requires a not null BigQueryClient in order to be able to call GetWriteStream, if the user always pass in BigQueryWriteClient, in the current code, we reuses that BigQueryWriteClient and then the customer header will not be added and routing will fail. So no matter whether we have an existing BigQueryWriteClient or not on the json writer, we always ask StreamWriter to create a new BigQueryWriteClient in order for routing to work. We are working on the backend to make this special workaround no longer needed.
1 parent b6b515f commit eec50c1

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonStreamWriter.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@ private JsonStreamWriter(Builder builder)
7373
this.descriptor =
7474
BQTableSchemaToProtoDescriptor.convertBQTableSchemaToProtoDescriptor(builder.tableSchema);
7575

76-
if (this.client == null) {
77-
streamWriterBuilder = StreamWriter.newBuilder(builder.streamName);
78-
} else {
79-
streamWriterBuilder = StreamWriter.newBuilder(builder.streamName, builder.client);
80-
}
76+
streamWriterBuilder = StreamWriter.newBuilder(builder.streamName);
8177
this.protoSchema = ProtoSchemaConverter.convert(this.descriptor);
8278
this.totalMessageSize = protoSchema.getSerializedSize();
8379
streamWriterBuilder.setWriterSchema(protoSchema);

0 commit comments

Comments
 (0)