google-cloud-cpp icon indicating copy to clipboard operation
google-cloud-cpp copied to clipboard

BigQuery `AppendRows` API could accept a `write_stream`

Open dbolduc opened this issue 3 years ago • 0 comments

We cannot currently send routing metadata for streaming writes. Mainly because we must configure the grpc::ClientContext before we know what the first request will be.

In BigQuery, the semantics are to add extra routing information in the initial request, via the write_stream field. (Note that write_stream is also listed as a method signature)

Maybe we should add std::string const& write_stream as a parameter to the client call. Then we could set internal::GrpcSetupOption to [write_stream] (auto& context) { context.AddMetadata("x-goog-request-params", write_stream); } in order to achieve routing. I do not know whether we should try to modify the initial request to set this field.

dbolduc avatar Jun 29 '22 14:06 dbolduc