Microsoft SQL Server To Google Cloud Storage 運算子

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

先決條件任務

若要使用這些運算子,您必須執行一些事項

MSSQLToGCSOperator

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

以下是如何使用此運算子上傳資料到 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 文件

此條目是否有幫助?