Google Cloud BigQuery 到 BigQuery 傳輸 Operator

Google Cloud BigQuery 是 Google Cloud 提供的無伺服器資料倉庫服務。此 Operator 可用於將資料從一個 BigQuery 表複製到另一個 BigQuery 表。

先決任務

要使用這些 Operators,您必須執行以下幾項操作:

Operator

使用 BigQueryToBigQueryOperator Operator 可以將資料從一個 BigQuery 表複製到另一個表。

Jinja 模板source_project_dataset_tables, destination_project_dataset_table, labels, impersonation_chain 一起使用,以動態定義值。

您可以包含多個源表,並定義 write_dispositioncreate_disposition。更多資訊請參閱上面的連結。

複製 BigQuery 表

以下 Operator 可將資料從一個或多個 BigQuery 表複製到另一個表。

tests/system/google/cloud/bigquery/example_bigquery_to_bigquery.py

copy_selected_data = BigQueryToBigQueryOperator(
    task_id="copy_selected_data",
    source_project_dataset_tables=f"{DATASET_NAME}.{ORIGIN}",
    destination_project_dataset_table=f"{DATASET_NAME}.{TARGET}",
)

參考資料

更多資訊請參閱:

此條目有幫助嗎?