Microsoft SQL Server 到 Google Cloud Storage Operator

Google Cloud Storage (GCS) 服務用於儲存來自各種應用程式的大量資料。本頁介紹如何將資料從 Microsoft SQL Server 複製到 GCS。

先決任務

要使用這些 Operator,您需要做幾件事

MSSQLToGCSOperator

MSSQLToGCSOperator 允許您將資料從 Microsoft SQL Server 資料庫上傳到 GCS。

以下是使用此 Operator 將資料上傳到 GCS 的示例。

tests/system/google/cloud/gcs/example_mssql_to_gcs.py

    upload_mssql_to_gcs = MSSQLToGCSOperator(
        task_id="mssql_to_gcs",
        mssql_conn_id="airflow_mssql",
        sql=SQL_QUERY,
        bucket=BUCKET_NAME,
        filename=FILENAME,
        export_format="csv",
    )

參考

更多資訊,請參閱: * Microsoft SQL Server 文件 * Google Cloud Storage 文件

此條目有幫助嗎?