Read and write data high-throughput at scale to Google BigQuery.
import apache_beam as beam
from apache_beam.io.gcp.bigquery import WriteToBigQuery
# Write records in storage api mode
records | "WriteBQ" >> WriteToBigQuery(
"my-project:my_dataset.my_table",
write_disposition=beam.io.BigQueryDisposition.WRITE_APPEND,
create_disposition=beam.io.BigQueryDisposition.CREATE_IF_NEEDED,
method=WriteToBigQuery.Method.STORAGE_WRITE_API
)