MSSQLToGCSOperator

Google

Copy data from Microsoft SQL Server to Google Cloud Storage in JSON, CSV or Parquet format.

View on GitHub

Last Updated: Mar. 4, 2023

Access Instructions

Install the Google provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

mssql_conn_idReference to a specific MSSQL hook.

Documentation

Copy data from Microsoft SQL Server to Google Cloud Storage in JSON, CSV or Parquet format.

Example:

The following operator will export data from the Customers table within the given MSSQL Database and then upload it to the ‘mssql-export’ GCS bucket (along with a schema file).

export_customers = MsSqlToGoogleCloudStorageOperator(
task_id='export_customers',
sql='SELECT * FROM dbo.Customers;',
bucket='mssql-export',
filename='data/customers/export.json',
schema_filename='schemas/export.json',
mssql_conn_id='mssql_default',
gcp_conn_id='google_cloud_default',
dag=dag
)

See also

For more information on how to use this operator, take a look at the guide: MSSQLToGCSOperator

Was this page helpful?