Set up the Openflow Connector for Google Sheets¶
Note
The connector is subject to the Connector Terms.
This topic describes the steps to set up the Openflow Connector for Google Sheets.
Prerequisites¶
Ensure that you have reviewed About Openflow Connector for Google Sheets.
Ensure that you have set up a Openflow.
Get the credentials¶
As a Google Cloud administrator, perform the following tasks:
Ensure that you have the following:
A Google user with Super Admin permissions
A Google Cloud Project with the following roles:
Enable service account key creation. Google disables service account key creation by default. This key creation policy must be turned off for Snowflake Openflow to use the service account JSON. To enable service account key creation, perform the following tasks:
Log in to the Google Cloud Console with a super admin account that has the Organizational Policy Admin role.
Ensure that you are in the project associated with your organization, not the project in your organization.
Select Organization Policies.
Select the Disable service account key creation policy.
Select Manage Policy and turn off enforcement.
Select Set Policy.
Set up Snowflake account¶
As a Snowflake account administrator, perform the following tasks:
Create a new role or use an existing role and grant the Database privileges.
Create a new Snowflake service user with the type as SERVICE.
Grant the Snowflake service user the role you created in the previous steps.
Configure with key-pair auth for the Snowflake SERVICE user from step 2.
Snowflake strongly recommends this step. Configure a secrets manager supported by Openflow, for example, AWS, Azure, and Hashicorp, and store the public and private keys in the secret store.
Note
If for any reason, you do not wish to use a secrets manager, then you are responsible for safeguarding the public key and private key files used for key-pair authentication according to the security policies of your organization.
Once the secrets manager is configured, determine how you will authenticate to it. On AWS, it’s recommended that you the EC2 instance role associated with Openflow as this way no other secrets have to be persisted.
In Openflow, configure a Parameter Provider associated with this Secrets Manager, from the hamburger menu in the upper right. Navigate to Controller Settings » Parameter Provider and then fetch your parameter values.
At this point all credentials can be referenced with the associated parameter paths and no sensitive values need to be persisted within Openflow.
If any other Snowflake users require access to the raw ingested documents and tables ingested by the connector (for example, for custom processing in Snowflake), then grant those users the role created in step 1.
Designate a warehouse for the connector to use. Start with the smallest warehouse size, then experiment with size depending on the number of tables being replicated, and the amount of data transferred. Large table numbers typically scale better with multi-cluster warehouses, rather than larger warehouse sizes.
Set up the connector¶
As a data engineer, perform the following tasks to install and configure the connector:
Install the connector¶
Navigate to the Openflow Overview page. In the Featured connectors section, select View more connectors.
On the Openflow connectors page, find the connector and select Add to runtime.
In the Select runtime dialog, select your runtime from the Available runtimes drop-down list.
Select Add.
Note
Before you install the connector, ensure that you have created a database and schema in Snowflake for the connector to store ingested data.
Authenticate to the deployment with your Snowflake account credentials and select Allow when prompted to allow the runtime application to access your Snowflake account. The connector installation process takes a few minutes to complete.
Authenticate to the runtime with your Snowflake account credentials.
The Openflow canvas appears with the connector process group added to it.
Configure the connector¶
Right-click on the imported process group and select Parameters.
Populate the required parameter values as described in Flow parameters.
Flow parameters¶
The configuration of the connector definition is divided into three parameter contexts:
Google Sheets Source Parameters: Used to establish connection with Google Sheets.
Google Sheets Destination Parameters: Used to establish connection with Snowflake.
Google Sheets Ingestion Parameters: Used to define the configuration of data downloaded from Google Sheets.
Note
The Google Sheets Ingestion Parameters parameter context contains spreadsheet-specific details, so you must create new parameter contexts for each new spreadsheet and process group.
To create a new parameter context, go to the Openflow Canvas menu, select Parameter Contexts and add a new parameter context. It inherits parameters from both the Google Sheets Destination Parameters and Google Sheets Source Parameters parameter contexts.
The following tables describe the flow parameters that you can configure based on the parameter contexts:
Google Sheets Destination Parameters¶
Parameter |
Description |
---|---|
Destination Database |
The database where data will be persisted. It must already exist in Snowflake |
Destination Schema |
The schema where data will be persisted. It must already exist in Snowflake |
Snowflake Account Identifier |
Snowflake account name formatted as [organization-name]-[account-name] where data will be persisted |
Snowflake Authentication Strategy |
Strategy of authentication to Snowflake. Possible values: SNOWFLAKE_SESSION_TOKEN - when we are running flow on SPCS, KEY_PAIR when we want to setup access using private key |
Snowflake Private Key |
The RSA private key used for authentication. The RSA key must be formatted according to PKCS8 standards and have standard PEM headers and footers. Note that either Snowflake Private Key File or Snowflake Private Key must be defined |
Snowflake Private Key File |
The file that contains the RSA Private Key used for authentication to Snowflake, formatted according to PKCS8 standards and having standard PEM headers and footers. The header line starts with |
Snowflake Private Key Password |
The password associated with the Snowflake Private Key File |
Snowflake Role |
Snowflake Role used during query execution |
Snowflake Username |
User name used to connect to Snowflake instance |
Snowflake Warehouse |
Snowflake warehouse used to run queries |
Google Sheets Source Parameters¶
Parameter |
Description |
---|---|
Service Account JSON |
Contents of the file containing Service Account credentials, such as client_id, client_email, and private_key. Copy the entire contents of the file. |
Google Sheets Ingestion Parameters¶
The following table lists only those parameters that are not inherited from other parameter contexts.
Parameter |
Description |
---|---|
Date Time Render Option |
Determines how dates should be rendered in the output. You can select one of these options: |
Destination Database |
The destination database in which the destination table is created. |
Destination Schema |
The destination schema in which the destination table is created. |
Destination Table Prefix |
The destination table prefix is where report data pulled from Google Sheets is stored. The connector creates one destination table for each range. The first row in a sheet represents the column names in the destination table. |
Ranges |
The list of ranges to retrieve from the spreadsheet. If no range is specified, all sheets in the specified spreadsheet will be downloaded.
Provide each range in either A1 or R1C1 notation, separated by a comma. For example: |
Run Schedule |
Run schedule on which data is retrieved from Google Sheets and saved in Snowflake.
By default, the timer-driven scheduling strategy is used and here the user specifies an interval, for example, |
Spreadsheet ID |
The unique identifier for a spreadsheet. You can find it in the URL of the spreadsheet. |
Value Render Option |
Determines how values should be rendered in the output.
You can select one of these options: |
Run the flow¶
Right-click on the plane and select Enable all Controller Services.
Right-click on the imported process group and select Start. The connector starts the data ingestion.