Write to BigQuery
This guide shows you how to create a BigQuery Write Component.
Prerequisites​
- BigQuery Connection with write permissions
- An Ascend Flow with a Component that contains data
Create a new Write Component​
Begin from your workspace Super Graph view. Follow these steps to create your Write Component:
- Using the Component Form
- Using the Files Panel
- Double-click the Flow where you want to create your component
- Right-click on any Component
- Hover over Create Downstream -> Write, and select your target Connection
- Complete the form with these details:
- Select your Flow
- Enter a descriptive Component Name like
write_mysql
- Open the Files panel in the top left corner
- Navigate to and select your desired Flow
- Right-click on the components directory and choose New file
- Name your file with a descriptive name like
write_mysql.yaml
and press enter
Configure your BigQuery Write Component
Follow these steps to set up your BigQuery Write Component:
- Configure your Connection
- Enter your BigQuery Connection name in the
connection
field
- Enter your BigQuery Connection name in the
- Specify a data source
- Set
input
to the Component that contains your source data
- Set
- Define the write target
- Configure the
bigquery
write connector options - Specify your target table name, schema, and other required properties
- Configure the
- Select a write strategy
Choose one of these strategies based on your use case:
Strategy Description Best For full
Replaces entire target during each Flow Run Reference tables, complete data refreshes partitioned
Updates only modified partitions Time-series data, regional datasets, date-partitioned data - Set strategy-specific options
- For
full
: usedrop_and_recreate
mode - For
partitioned
: useappend
,insert_overwrite
, orsync
mode
- For
Examples​
Choose the write strategy that best fits your use case:
- Full write strategy
- Partitioned write strategy
This example shows a BigQuery Write Component that uses a full write strategy with drop_and_recreate
mode.
This strategy replaces all data in the target table during each Flow Run, ensuring a complete refresh.
component:
write:
connection: write_bigquery
input:
name: my_component
flow: my_flow
bigquery:
table:
name: my_table
dataset: my_output_dataset
strategy:
full:
mode: drop_and_recreate
This example shows a BigQuery Write Component that uses a partitioned write strategy with sync
mode.
This strategy only updates modified partitions while preserving existing partitions, which is more efficient for large datasets.
component:
write:
connection: write_bigquery
input:
name: my_component
flow: my_flow
strategy:
partitioned:
mode: sync
bigquery:
table:
name: my_partitioned_table
dataset: my_output_dataset
🎉 Congratulations! You successfully created a BigQuery Write Component in Ascend.