Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

BigQuery Storage Write API and multiple tables

Hi everybody,

I am implementing a service in GO that will stream incoming logs (from other services) into BigQuery, using the new Storage Write API.

My question is how to handle writing to different tables (the destination table is decided by the GO service based on some attributes of the incoming logs).

Should the GO service open a separate BigQuery write stream for each table, or it's possible to write to different tables within the same write stream? Thanks!

Diego

Solved Solved
1 3 2,341
1 ACCEPTED SOLUTION

When using the BigQuery Storage Write API, each write stream is associated with a specific table. Therefore, if you want to write to multiple tables, you'll need to manage multiple write streams, one for each table.

You cannot write to different tables within the same write stream. Each stream is bound to a specific table at the time of its creation.

For implementing this in Go, you'd use the BigQuery Storage Write API's Go client library. The actual methods and usage might differ from the standard BigQuery API. I recommend referring to the official Google Cloud documentation and the Go client library's reference for accurate methods and examples.

View solution in original post

3 REPLIES 3