Schedule a Snowflake transfer

Preview

This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.

Note: To get support, provide feedback, or inquire about the limitations of this feature, contactdts-migration-preview-support@google.com.

The Snowflake connector provided by the BigQuery Data Transfer Service lets youschedule and manage automated transfer jobs to migrate data from Snowflakeinto BigQuery using public IP allow lists.

Overview

The Snowflake connector engages migration agents in theGoogle Kubernetes Engine and triggers a load operation from Snowflake to astaging area within the same cloud provider where Snowflake ishosted.

  • For AWS-hosted Snowflake accounts, thedata is first staged in your Amazon S3 bucket, which is then transferredto BigQuery with the BigQuery Data Transfer Service.
  • ForGoogle Cloud-hosted Snowflake accounts, the data is firststaged in your Cloud Storage bucket, which is then transferredto BigQuery with the BigQuery Data Transfer Service.
  • For Azure-hosted Snowflake accounts, the data is firststaged in your Azure Blob Storage container, which is then transferredto BigQuery with the BigQuery Data Transfer Service.

Limitations

Data transfers made using the Snowflake connector are subject tothe following limitations:

  • The Snowflake connector doesn't support incremental data transfers.
  • The Snowflake connector only supports transfers from tableswithin a single Snowflake database and schema. To transfer fromtables with multiple Snowflake databases or schemas, you canset up each transfer job separately.
  • The speed of loading data from Snowflake to your Amazon S3bucket or Azure Blob Storage container or Cloud Storage bucket is limited by the Snowflake warehouse you have chosenfor this transfer.

Before you begin

Before you set up a Snowflake transfer, you must perform all thesteps listed in this section. The following is a list of all required steps.

  1. Prepare your Google Cloud project
  2. Required BigQuery roles
  3. Prepare your staging bucket
  4. Create a Snowflake user with the required permissions
  5. Add network policies
  6. Optional:Schema detection and mapping
  7. Assess your Snowflake for any unsupported data types
  8. Gather transfer information

Prepare your Google Cloud project

Create and configure your Google Cloud project for a Snowflaketransfer with the following steps:

  1. Create a Google Cloud project or select an existing project.

    Note: If you don't plan on keeping the resources created during thisSnowflake transfer, create a new Google Cloud project insteadof selecting an existing one. You can then delete the project once you aredone with your Snowflake transfer.
  2. Verify that you have completed all actions required toenable the BigQuery Data Transfer Service.

  3. Create a BigQuery dataset to storeyour data. You don't need to create any tables.

Required BigQuery roles

To get the permissions that you need to create a BigQuery Data Transfer Service data transfer, ask your administrator to grant you theBigQuery Admin (roles/bigquery.admin) IAM role on your project. For more information about granting roles, seeManage access to projects, folders, and organizations.

This predefined role contains the permissions required to create a BigQuery Data Transfer Service data transfer. To see the exact permissions that are required, expand theRequired permissions section:

Required permissions

The following permissions are required to create a BigQuery Data Transfer Service data transfer:

  • BigQuery Data Transfer Service permissions:
    • bigquery.transfers.update
    • bigquery.transfers.get
  • BigQuery permissions:
    • bigquery.datasets.get
    • bigquery.datasets.getIamPolicy
    • bigquery.datasets.update
    • bigquery.datasets.setIamPolicy
    • bigquery.jobs.create

You might also be able to get these permissions withcustom roles or otherpredefined roles.

For more information, seeGrantbigquery.admin access.

Note: For ease of selection of your service account and the Cloud Storagebucket URI during transfer creation, we recommend that you grant theiam.serviceAccounts.list andstorage.buckets.list permissions on the usercreating the transfer configuration.

Prepare staging bucket

To complete a Snowflake data transfer, you must create a stagingbucket and then configure it to allow write access from Snowflake.

Staging bucket for AWS-hosted Snowflake account

For AWS-hosted Snowflake account, create anAmazon S3 bucket to stage the Snowflake data before it isloaded into BigQuery.

  1. Create an Amazon S3 bucket.

  2. Create and configure a Snowflake storage integration objectto allow Snowflake to write data into the Amazon S3bucket as an external stage.

To allow read access on your Amazon S3 bucket,you must also do the following:

  1. Create a dedicatedAmazon IAM userand grant it theAmazonS3ReadOnlyAccesspolicy.

  2. Create an Amazon access key pairfor the IAM user.

Staging Azure Blob Storage container for Azure-hosted Snowflake account

For Azure-hosted Snowflake accounts, create aAzure Blob Storage container to stage the Snowflake data before itis loaded into BigQuery.

  1. Create an Azure storage account and astorage container within it.
  2. Create and configure a Snowflake storage integration objectto allow Snowflake to write data into the Azure storagecontainer as an external stage. Note that 'Step 3: Creating an external stage' can be skipped as we don't use it.

To allow read access on your Azure container,generate a SAS Token for it.

Staging bucket for Google Cloud-hosted Snowflake account

For Google Cloud-hosted Snowflake accounts, create aCloud Storage bucket to stage the Snowflake data before itis loaded into BigQuery.

  1. Create a Cloud Storage bucket.
  2. Create and configure a Snowflake storage integration objectto allow Snowflake to write data into the Cloud Storagebucket as an external stage.
  3. To allow access to staging bucket, GrantDTS service agent theroles/storage.objectViewer role withthe following command:

    gcloudstoragebucketsadd-iam-policy-bindinggs://STAGING_BUCKET_NAME\--member=serviceAccount:service-PROJECT_NUMBER@gcp-sa-bigquerydatatransfer.iam.gserviceaccount.com\--role=roles/storage.objectViewer

Create a Snowflake user with the required permissions

During a Snowflake transfer, the Snowflakeconnector connects to your Snowflake account using a JDBCconnection. You must create a new Snowflake userwith a custom role that only has the necessary privileges to perform thedata transfer:

  // Create and configure new role,MIGRATION_ROLE  GRANT USAGE    ON WAREHOUSEWAREHOUSE_NAME    TO ROLEMIGRATION_ROLE;  GRANT USAGE    ON DATABASEDATABASE_NAME    TO ROLEMIGRATION_ROLE;  GRANT USAGE    ON SCHEMADATABASE_NAME.SCHEMA_NAME    TO ROLEMIGRATION_ROLE;  // You can modify this to give select permissions for all tables in a schema  GRANT SELECT    ON TABLEDATABASE_NAME.SCHEMA_NAME.TABLE_NAME    TO ROLEMIGRATION_ROLE;  GRANT USAGE    ONSTORAGE_INTEGRATION_OBJECT_NAME    TO ROLEMIGRATION_ROLE;

Replace the following:

  • MIGRATION_ROLE: the name of the custom role you arecreating
  • WAREHOUSE_NAME: the name of your data warehouse
  • DATABASE_NAME: the name of your Snowflakedatabase
  • SCHEMA_NAME: the name of your Snowflakeschema
  • TABLE_NAME: the name of the Snowflakeincluded in this data transfer
  • STORAGE_INTEGRATION_OBJECT_NAME: the name of yourSnowflake storage integration object.

Generate key pair for authentication

Due to thedeprecation of single factor password sign-ins by Snowflake, we recommend that you use key pair for authentication.

You can configure a key pair by generating an encrypted or unencrypted RSA key pair, then assigning the public key to a Snowflake user. For more information, seeConfiguring key-pair authentication.

Add network policies

For public connectivity, the Snowflake account allows public connectionwith database credentials by default. However, you might have configured network rules orpolicies that could prevent the Snowflake connector fromconnecting to your account. In this case, you must add the necessary IPaddresses to your allowlist.

The following table is a list of IP addresses for the regional andmulti-regional locations used for public transfers. You can either add theIP addresses that only correspond to your dataset's location, or you can add allthe IP addresses listed in the table. These are IP addresses reserved by Googlefor BigQuery Data Transfer Service data transfers.

To add an IP address to an allowlist, do the following:

  1. Create a network rulewithtype =IPV4. The BigQuery Data Transfer Service uses a JDBC connection toconnect to the Snowflake account.
  2. Create a network policywith the network rule that you created earlier and the IP address from thefollowing table.
Caution: The communication between BigQuery andSnowflake happens through the following Google-owned IP addresses.However, the data movement from Amazon S3 to BigQueryhappens over the public internet.

Regional locations

Region descriptionRegion nameIP addresses
Americas
Columbus, Ohious-east534.162.72.184
34.162.173.185
34.162.205.205
34.162.81.45
34.162.182.149
34.162.59.92
34.162.157.190
34.162.191.145
Dallasus-south134.174.172.89
34.174.40.67
34.174.5.11
34.174.96.109
34.174.148.99
34.174.176.19
34.174.253.135
34.174.129.163
Iowaus-central134.121.70.114
34.71.81.17
34.122.223.84
34.121.145.212
35.232.1.105
35.202.145.227
35.226.82.216
35.225.241.102
Las Vegasus-west434.125.53.201
34.125.69.174
34.125.159.85
34.125.152.1
34.125.195.166
34.125.50.249
34.125.68.55
34.125.91.116
Los Angelesus-west235.236.59.167
34.94.132.139
34.94.207.21
34.94.81.187
34.94.88.122
35.235.101.187
34.94.238.66
34.94.195.77
Mexiconorthamerica-south134.51.6.35
34.51.7.113
34.51.12.83
34.51.10.94
34.51.11.219
34.51.11.52
34.51.2.114
34.51.15.251
Montréalnorthamerica-northeast134.95.20.253
35.203.31.219
34.95.22.233
34.95.27.99
35.203.12.23
35.203.39.46
35.203.116.49
35.203.104.223
Northern Virginiaus-east435.245.95.250
35.245.126.228
35.236.225.172
35.245.86.140
35.199.31.35
35.199.19.115
35.230.167.48
35.245.128.132
35.245.111.126
35.236.209.21
Oregonus-west135.197.117.207
35.199.178.12
35.197.86.233
34.82.155.140
35.247.28.48
35.247.31.246
35.247.106.13
34.105.85.54
Salt Lake Cityus-west334.106.37.58
34.106.85.113
34.106.28.153
34.106.64.121
34.106.246.131
34.106.56.150
34.106.41.31
34.106.182.92
São Paolosouthamerica-east135.199.88.228
34.95.169.140
35.198.53.30
34.95.144.215
35.247.250.120
35.247.255.158
34.95.231.121
35.198.8.157
Santiagosouthamerica-west134.176.188.48
34.176.38.192
34.176.205.134
34.176.102.161
34.176.197.198
34.176.223.236
34.176.47.188
34.176.14.80
South Carolinaus-east135.196.207.183
35.237.231.98
104.196.102.222
35.231.13.201
34.75.129.215
34.75.127.9
35.229.36.137
35.237.91.139
Torontonorthamerica-northeast234.124.116.108
34.124.116.107
34.124.116.102
34.124.116.80
34.124.116.72
34.124.116.85
34.124.116.20
34.124.116.68
Europe
Belgiumeurope-west135.240.36.149
35.205.171.56
34.76.234.4
35.205.38.234
34.77.237.73
35.195.107.238
35.195.52.87
34.76.102.189
Berlineurope-west1034.32.28.80
34.32.31.206
34.32.19.49
34.32.33.71
34.32.15.174
34.32.23.7
34.32.1.208
34.32.8.3
Finlandeurope-north135.228.35.94
35.228.183.156
35.228.211.18
35.228.146.84
35.228.103.114
35.228.53.184
35.228.203.85
35.228.183.138
Frankfurteurope-west335.246.153.144
35.198.80.78
35.246.181.106
35.246.211.135
34.89.165.108
35.198.68.187
35.242.223.6
34.89.137.180
Londoneurope-west235.189.119.113
35.189.101.107
35.189.69.131
35.197.205.93
35.189.121.178
35.189.121.41
35.189.85.30
35.197.195.192
Madrideurope-southwest134.175.99.115
34.175.186.237
34.175.39.130
34.175.135.49
34.175.1.49
34.175.95.94
34.175.102.118
34.175.166.114
Milaneurope-west834.154.183.149
34.154.40.104
34.154.59.51
34.154.86.2
34.154.182.20
34.154.127.144
34.154.201.251
34.154.0.104
Netherlandseurope-west435.204.237.173
35.204.18.163
34.91.86.224
34.90.184.136
34.91.115.67
34.90.218.6
34.91.147.143
34.91.253.1
Pariseurope-west934.163.76.229
34.163.153.68
34.155.181.30
34.155.85.234
34.155.230.192
34.155.175.220
34.163.68.177
34.163.157.151
Stockholmeurope-north234.51.133.48
34.51.136.177
34.51.128.140
34.51.141.252
34.51.139.127
34.51.142.55
34.51.134.218
34.51.138.9
Turineurope-west1234.17.15.186
34.17.44.123
34.17.41.160
34.17.47.82
34.17.43.109
34.17.38.236
34.17.34.223
34.17.16.47
Warsaweurope-central234.118.72.8
34.118.45.245
34.118.69.169
34.116.244.189
34.116.170.150
34.118.97.148
34.116.148.164
34.116.168.127
Züricheurope-west634.65.205.160
34.65.121.140
34.65.196.143
34.65.9.133
34.65.156.193
34.65.216.124
34.65.233.83
34.65.168.250
Asia Pacific
Delhiasia-south234.126.212.96
34.126.212.85
34.126.208.224
34.126.212.94
34.126.208.226
34.126.212.232
34.126.212.93
34.126.212.206
Hong Kongasia-east234.92.245.180
35.241.116.105
35.220.240.216
35.220.188.244
34.92.196.78
34.92.165.209
35.220.193.228
34.96.153.178
Jakartaasia-southeast234.101.79.105
34.101.129.32
34.101.244.197
34.101.100.180
34.101.109.205
34.101.185.189
34.101.179.27
34.101.197.251
Melbourneaustralia-southeast234.126.196.95
34.126.196.106
34.126.196.126
34.126.196.96
34.126.196.112
34.126.196.99
34.126.196.76
34.126.196.68
Mumbaiasia-south134.93.67.112
35.244.0.1
35.200.245.13
35.200.203.161
34.93.209.130
34.93.120.224
35.244.10.12
35.200.186.100
Osakaasia-northeast234.97.94.51
34.97.118.176
34.97.63.76
34.97.159.156
34.97.113.218
34.97.4.108
34.97.119.140
34.97.30.191
Seoulasia-northeast334.64.152.215
34.64.140.241
34.64.133.199
34.64.174.192
34.64.145.219
34.64.136.56
34.64.247.158
34.64.135.220
Singaporeasia-southeast134.87.12.235
34.87.63.5
34.87.91.51
35.198.197.191
35.240.253.175
35.247.165.193
35.247.181.82
35.247.189.103
Sydneyaustralia-southeast135.189.33.150
35.189.38.5
35.189.29.88
35.189.22.179
35.189.20.163
35.189.29.83
35.189.31.141
35.189.14.219
Taiwanasia-east135.221.201.20
35.194.177.253
34.80.17.79
34.80.178.20
34.80.174.198
35.201.132.11
35.201.223.177
35.229.251.28
35.185.155.147
35.194.232.172
Tokyoasia-northeast134.85.11.246
34.85.30.58
34.85.8.125
34.85.38.59
34.85.31.67
34.85.36.143
34.85.32.222
34.85.18.128
34.85.23.202
34.85.35.192
Middle East
Dammamme-central2 34.166.20.177
34.166.10.104
34.166.21.128
34.166.19.184
34.166.20.83
34.166.18.138
34.166.18.48
34.166.23.171
Dohame-central134.18.48.121
34.18.25.208
34.18.38.183
34.18.33.25
34.18.21.203
34.18.21.80
34.18.36.126
34.18.23.252
Tel Avivme-west134.165.184.115
34.165.110.74
34.165.174.16
34.165.28.235
34.165.170.172
34.165.187.98
34.165.85.64
34.165.245.97
Africa
Johannesburgafrica-south134.35.11.24
34.35.10.66
34.35.8.32
34.35.3.248
34.35.2.113
34.35.5.61
34.35.7.53
34.35.3.17

Multi-regional locations

Multi-region descriptionMulti-region nameIP addresses
Data centers withinmember states of the European Union1EU34.76.156.158
34.76.156.172
34.76.136.146
34.76.1.29
34.76.156.232
34.76.156.81
34.76.156.246
34.76.102.206
34.76.129.246
34.76.121.168
Data centers in the United StatesUS35.185.196.212
35.197.102.120
35.185.224.10
35.185.228.170
35.197.5.235
35.185.206.139
35.197.67.234
35.197.38.65
35.185.202.229
35.185.200.120

1 Data located in theEU multi-region is notstored in theeurope-west2 (London) oreurope-west6 (Zürich) datacenters.

Schema detection and mapping

To define your schema, you can use the BigQuery Data Transfer Service to automatically detect schema and data-type mapping when transferring data from Snowflake to BigQuery. Alternatively, you can use the translation engine to define your schema and data types manually.

Default Schema Detection

The Snowflake connector can automatically detect your Snowflake table schema. To use automatic schema detection, you can leave theTranslation output GCS path field blank when youset up a Snowflake transfer.

The following list shows how the Snowflake connector maps your Snowflake data types into BigQuery:

  • The following data types are mapped asSTRING in BigQuery:
    • TIMESTAMP_TZ
    • TIMESTAMP_LTZ
    • OBJECT
    • VARIANT
    • ARRAY
  • The following data types are mapped asTIMESTAMP in BigQuery:
    • TIMESTAMP_NTZ

All other Snowflake data types are mapped directly to their equivalent types in BigQuery.

Using translation engine output for schema

To define your schema manually (for example, to override certain schema attributes), you can generate your metadata and run the translation engine with the following steps:

Limitations
  • Data is extracted from Snowflake in the Parquet data formatbefore it is loaded into BigQuery:

    • The following Parquet data types are unsupported:
    • The following Parquet data types are unsupported, but can be converted:

      • TIMESTAMP_NTZ
      • OBJECT,VARIANT,ARRAY

      Use theglobal type conversion configuration YAMLto override the default behavior of these data types when you run translation engine.

      The configuration YAML might look similar to the following example:

      type:experimental_object_rewriterglobal:typeConvert:datetime:TIMESTAMPjson:VARCHAR

The BigQuery Data Transfer Service for Snowflake connector uses the BigQuerymigration service translation engine for schema mapping when migrating Snowflaketables into BigQuery. To complete a Snowflakedata transfer, you must first generate metadata for translation, then run thetranslation engine:

  1. Run thedwh-migration-tool for Snowflake. For moreinformation, seeGenerate metadata for translation and assessment.
  2. Upload the generatedmetadata.zip file to a Cloud Storage bucket. Themetadata.zip file is used as input for the translation engine.
  3. Run the batch translation service, specifying thetarget_types field asmetadata. For more information, seeTranslate SQL queries with the translation API.

    • The following is an example of a command to run a batch translation for Snowflake:
    curl-d"{  \"name\": \"sf_2_bq_translation\",  \"displayName\": \"Snowflake to BigQuery Translation\",  \"tasks\": {      string: {        \"type\": \"Snowflake2BigQuery_Translation\",        \"translation_details\": {            \"target_base_uri\": \"gs://sf_test_translation/output\",            \"source_target_mapping\": {              \"source_spec\": {                  \"base_uri\": \"gs://sf_test_translation/input\"              }            },            \"target_types\": \"metadata\",        }      }  },  }"\-H"Content-Type:application/json"\-H"Authorization: Bearer TOKEN"-XPOSThttps://bigquerymigration.googleapis.com/v2alpha/projects/project_id/locations/location/workflows
    • You can check the status of this command in theSQL Translation page in BigQuery.The output of the batch translation job is stored ings://translation_target_base_uri/metadata/config/.

Required service account permissions

In a Snowflake transfer, a service account is used to readdata from the translation engine output in the specified Cloud Storage path.You must grant the service account thestorage.objects.get and thestorage.objects.list permissions.

We recommend that the service account belongs to the same Google Cloud projectwhere the transfer configuration and destination dataset is created. If theservice account is in a Google Cloud project that is different from theproject that created the BigQuery data transfer, then you mustenable cross-project service account authorization.

For more information, seeBigQuery IAM roles and permissions.

Assess Snowflake data

BigQuery writes data from Snowflake toCloud Storage as Parquet files. Parquet files don't support theTIMESTAMP_TZ andTIMESTAMP_LTZdata types. If your data contains these types, you can export it toAmazon S3 as CSV files and then import the CSV files intoBigQuery. For more information, seeOverview ofAmazon S3 transfers.

Gather transfer information

Gather the information that you need to set up the migration with the BigQuery Data Transfer Service:

Set up a Snowflake transfer

Select one of the following options:

Console

  1. Go to the Data transfers page in the Google Cloud console.

    Go to Data transfers

  2. ClickCreate transfer.

  3. In theSource type section, selectSnowflake Migrationfrom theSource list.

  4. In theTransfer config name section, enter a name for the transfer,such asMy migration, in theDisplay name field. The display namecan be any value that lets you identify the transfer ifyou need to modify it later.

  5. In theDestination settings section, choosethe dataset you created from theDataset list.

  6. In theData source details section, do the following:

    1. ForAccount identifier, enter a unique identifier for your Snowflakeaccount, which is a combination of your organization name and accountname. The identifier is the prefix of Snowflake accountURL and not the complete URL. For example,ACCOUNT_IDENTIFIER.snowflakecomputing.com.
    2. ForUsername, enter the username of the Snowflakeuser whose credentials and authorization is used to access yourdatabase to transfer the Snowflake tables. We recommendusingthe user that you created for this transfer.
    3. ForAuth mechanism, select a Snowflake userauthentication method. For more information, seeGenerate key pair for authentication
    4. ForPassword, enter the password of the Snowflakeuser. This field is required if you have selectedPASSWORD in theAuth mechanism field.
    5. ForPrivate key, enter the private key linked with thepublic key associated with the Snowflake user.This field is required if you have selectedKEY_PAIR in theAuth mechanism field.
    6. ForIs Private key encrypted, select this field if the privatekey is encrypted with a passphrase.
    7. ForPrivate key passphrase, enter the passphrase for theencrypted private key. This field is required if you have selectedKEY_PAIR in theAuth mechanism andIs Private Key Encrypted fields.
    8. ForWarehouse, enter awarehousethat is used for the execution of this data transfer.
    9. ForService account, enter a service account to use with thisdata transfer. The service account should belong to the sameGoogle Cloud project where the transfer configuration and destinationdataset is created. The service account must have thestorage.objects.list andstorage.objects.getrequired permissions.
    10. ForDatabase, enter the name of the Snowflakedatabase that contains the tables included in this data transfer.
    11. ForSchema, enter the name of the Snowflakeschema that contains the tables included in this data transfer.
    12. ForTable name patterns, specify a table to transfer by enteringa name or a pattern that matches the table name in the schema. Youcan use regular expressions to specify the pattern, for exampletable1_regex;table2_regex. Thepattern should follow Java regular expression syntax. For example,

      • lineitem;ordertb matches tables that are namedlineitem andordertb.
      • .* matches all tables.
    13. Optional: ForTranslation output GCS path, specify a path to theCloud Storage folder that contains theschema mapping files from the translation engine. You can leave this empty to have the Snowflake connector automatically detect your schema.

      • The path should follow the formattranslation_target_base_uri/metadata/config/db/schema/and must end with/.
    14. ForStorage integration object name, enter the name of the Snowflakestorage integration object.

    15. ForCloud provider, selectAWS orAZURE orGCP depending on whichcloud provider is hosting your Snowflake account.

    16. ForAmazon S3 URI, enter theURI of the Amazon S3 bucketto use as a staging area. Only required when yourCloud Provider isAWS.

    17. ForAccess key ID andSecret access key, enter theaccess key pair. Only required when yourCloud Provider isAWS.

    18. ForAzure Storage Account andAzure Storage Container, enter thestorage account and container name of the Azure Blob Storageto use as a staging area. Only required when yourCloud Provider isAZURE.

    19. ForSAS Token, enter theSAS token generated for the container. Only required when yourCloud Provider isAZURE.

    20. ForGCS URI, enter theURI of the Cloud Storageto use as a staging area. Only required when yourCloud Provider isGCP.

  7. Optional: In theNotification options section, do the following:

    1. Click the toggle to enable email notifications. When you enable thisoption, the transfer administrator receives an email notificationwhen a transfer run fails.
    2. ForSelect a Pub/Sub topic, choose yourtopicname or clickCreate a topic. This optionconfigures Pub/Sub runnotificationsfor your transfer.
  8. ClickSave.

  9. The Google Cloud console displays all the transfer setup details,including aResource name for this transfer.

bq

Enter thebq mk command and supply the transfer creation flag--transfer_config. The following flags are also required:

  • --project_id
  • --data_source
  • --target_dataset
  • --display_name
  • --params
bqmk\--transfer_config\--project_id=project_id\--data_source=data_source\--target_dataset=dataset\--display_name=name\--service_account_name=service_account\--params='parameters'

Replace the following:

  • project_id: your Google Cloud project ID. If--project_idisn't specified, the default project is used.
  • data_source: the data source,snowflake_migration.
  • dataset: the BigQuery target dataset for thetransfer configuration.
  • name: the display name for the transfer configuration. Thetransfer name can be any value that lets you identify thetransfer if you need to modify it later.
  • service_account: (Optional) the service account name used toauthenticate your transfer. The service account should be owned by the sameproject_id used to create the transfer and it should have all of therequired roles.
  • parameters: the parameters for the created transferconfiguration in JSON format. For example:--params='{"param":"param_value"}'.

Parameters required for an Snowflake transfer configuration are:

  • account_identifier: specify a unique identifier for your Snowflake account, which is a combination of your organization name and account name. The identifier is the prefix of Snowflake account URL and not the complete URL. For example,account_identifier.snowflakecomputing.com.
  • username: specify the username of the Snowflake user whose credentials and authorization is used to access your database to transfer the Snowflake tables.
  • auth_mechanism: specify the Snowflake user authentication method. Supported values arePASSWORD andKEY_PAIR. For more information, seeGenerate key pair for authentication.
  • password: specify the password of the Snowflake user. This field is required if you have specifiedPASSWORD in theauth_mechanism field.
  • private_key : specify the private key linked with thepublic key associated with the Snowflake user. This field is required if you have specifiedKEY_PAIR in theauth_mechanism field.
  • is_private_key_encrypted : specifytrue if the private key is encrypted with a passphrase.
  • private_key_passphrase : specify the passphrase for the encrypted private key. This field is required if you have specifiedKEY_PAIR in theauth_mechanism field and specifiedtrue in theis_private_key_encrypted field.
  • warehouse: specify awarehousethat is used for the execution of this data transfer.
  • service_account: specify a service account to use with this data transfer. The service account should belong to the same Google Cloud project where the transfer configuration and destination dataset is created. The service account must have thestorage.objects.list andstorage.objects.getrequired permissions.
  • database: specify the name of the Snowflake database that contains the tables included in this data transfer.
  • schema: specify the name of the Snowflake schema that contains the tables included in this data transfer.
  • table_name_patterns: specify a table to transfer by entering a name or a pattern that matches the table name in the schema. You can use regular expressions to specify the pattern, for exampletable1_regex;table2_regex. The pattern should follow Java regular expression syntax. For example,

    • lineitem;ordertb matches tables that are namedlineitem andordertb.
    • .* matches all tables.

      You can also leave this field blank to migrate all tables from thespecified schema.

  • translation_output_gcs_path: (Optional) specify a path to the Cloud Storage folder that contains theschema mapping files from the translation engine. You can leave this empty to have the Snowflake connector automatically detect your schema.

    • The path should follow the formatgs://translation_target_base_uri/metadata/config/db/schema/and must end with/.
  • storage_integration_object_name: specify the name of the Snowflake storage integration object.

  • cloud_provider: enterAWS orAZURE orGCP depending on which cloud provider is hosting your Snowflake account.

  • staging_s3_uri: enter theURI of the S3 bucket to use as a staging area. Only required when yourcloud_provider isAWS.

  • aws_access_key_id: enter theaccess key pair. Only required when yourcloud_provider isAWS.

  • aws_secret_access_key: enter theaccess key pair. Only required when yourcloud_provider isAWS.

  • azure_storage_account: enter thestorage account name to use as a staging area. Only required when yourcloud_provider isAZURE.

  • staging_azure_container: enter thecontainer within Azure Blob Storage to use as a staging area. Only required when yourcloud_provider isAZURE.

  • azure_sas_token: enter theSAS token. Only required when yourcloud_provider isAZURE.

  • staging_gcs_uri : enter theURI of the Cloud Storage to use as a staging area. Only required when yourcloud_provider isGCP.

For example, for an AWS-hosted Snowflakeaccount, the following command creates a Snowflake transfernamedSnowflake transfer config with a target dataset namedyour_bq_datasetand a project with the ID ofyour_project_id.

PARAMS='{  "account_identifier": "your_account_identifier",  "auth_mechanism": "KEY_PAIR",  "aws_access_key_id": "your_access_key_id",  "aws_secret_access_key": "your_aws_secret_access_key",  "cloud_provider": "AWS",  "database": "your_sf_database",  "private_key": "-----BEGIN PRIVATE KEY----- privatekey\nseparatedwith\nnewlinecharacters=-----END PRIVATE KEY-----",  "schema": "your_snowflake_schema",  "service_account": "your_service_account",  "storage_integration_object_name": "your_storage_integration_object",  "staging_s3_uri": "s3://your/s3/bucket/uri",  "table_name_patterns": ".*",  "translation_output_gcs_path": "gs://sf_test_translation/output/metadata/config/database_name/schema_name/",  "username": "your_sf_username",  "warehouse": "your_warehouse"}'bqmk--transfer_config\--project_id=your_project_id\--target_dataset=your_bq_dataset\--display_name='snowflake transfer config'\--params="$PARAMS"\--data_source=snowflake_migration
Note: You can't configure notifications using the command-linetool.

API

Use theprojects.locations.transferConfigs.createmethod and supply an instance of theTransferConfigresource.

If multiple transfers are created for the sameSnowflake tables or if the same transfer configuration is run multiple times, the data in the existing BigQuerydestination tables is overwritten.

Quotas and limits

BigQuery has a load quota of 15 TB for each load job for eachtable. Internally, Snowflake compresses the table data, so theexported table size is larger than the table size reported bySnowflake. If you plan to migrate a table larger than 15 TB,please contact contactdts-migration-preview-support@google.com.

Because ofAmazon S3's consistency model,it's possible that some files won't be included in the transfer toBigQuery.

Pricing

For information on BigQuery Data Transfer Service pricing, see thePricingpage.

  • If the Snowflake warehouse and the Amazon S3bucket are in different regions, then Snowflake applies egresscharges when you run a Snowflake data transfer. There are noegress charges for Snowflake data transfers if both theSnowflake warehouse and the Amazon S3 bucket are in thesame region.
  • When data is transferred from AWS to Google Cloud,inter-cloud egress charges are applied.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.