Skip to main content

Symon.AI Help Center

Snowflake

Abstract

Connect your Symon.AI and Snowflake accounts to import your data.

Connect your Symon.AI and Snowflake accounts to import your data.

Before you begin

Before you can create a connection between Symon.AI to import data from Snowflake, you will need a Snowflake account.

Supported data sources

This connector can import data from the Databases you define within your Snowflake role under the Snowflake account.

Using OAuth authentication

If you want to use the OAuth authentication method for connecting Symon.AI to your Snowflake account, you must first create a security integration object.

Important

Only users with the ACCOUNTADMIN role can create a security integration object. Snowflake does not allow the following roles to log in through OAuth: ACCOUNTADMIN, SECURITYADMIN, and ORGADMIN. Learn more...

Creating a security integration object
  1. Open your Snowflake instance.

  2. In Snowflake, enter the following query to create the security integration object:

    CREATE OR REPLACE SECURITY INTEGRATION <name>
      TYPE=OAUTH
      OAUTH_CLIENT=CUSTOM
      OAUTH_REDIRECT_URI='<redirect URI>' 
      OAUTH_CLIENT_TYPE='CONFIDENTIAL'
      OAUTH_REFRESH_TOKEN_VALIDITY = <1 ~ 90 days in seconds>
      OAUTH_ISSUE_REFRESH_TOKENS=TRUE
      ENABLED=TRUE;
    1. Replace the following variables with the correct information for your instance:

      Table 19. Snowflake OAuth variables

      Variable

      Description

      Name

      Enter the name of the security integration.

      Redirect URI

      Enter the import redirect URI of the Symon.AI application.

      For NA: https://app.symon.ai/importRedirect

      For EU: https://eu.symon.ai/importRedirect

      OAUTH_REFRESH_TOKEN_VALIDITY

      Enter the integer that specifies how long the refresh token is valid for in seconds. This value is used to expire the refresh token periodically.



    Learn more about creating a security integration.

    Caution

    Re-running the query with the same security integration name will replace the existing security object. This action will rotate the existing client id and client secret. Any connections tied to the security integration object are no longer valid and the user must edit the Snowflake connection tied to the security integration with a new client id and client secret pair.

  3. Enter the following query to get the client id and secret:

    SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('<security integration name in capital letters>');

    This query returns values for OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET, OAUTH_CLIENT_SECRET_2. You can use either OAUTH_CLIENT_SECRET or OAUTH_CLIENT_SERCRET_2 as your client secret.

    Note

    If the refresh token expires, you must edit the connection and reauthorize. The Client ID and Client Secret can be retrieved with the query in Step 3.

Import

With the correct permissions in place, you can now import your data into Symon.AI.

Importing data
  1. In Symon.AI, go to the Data tab.

  2. Click Import data.

  3. In the Third party sources section, click Snowflake.

  4. Click New connection.

  5. On the Connect to your Database page, enter the following information to connect:

    Table 20. Snowflake

    Field

    Description

    Connector name

    The name of the connection.

    Snowflake URL

    The URL to connect to Snowflake. You can use the account URL copied from the Snowflake app, or you can use https://<org_name>-<account_name>.snowflakecomputing.com.

    Note

    The org_name is the name of your Snowflake organization.

    The account_name is the unique name of your account within your organization.

    Snowflake role

    The role in Snowflake, such as <user>_role.

    Note

    The Snowflake role is an optional parameter. If you don't provide the role, the connection uses the default role.

    Warehouse

    The name of the Snowflake warehouse your data runs out of.

    Database name

    The name of the Snowflake database.

    Authentication method

    Select either the Basic standard authentication method or OAuth authentication method

    Basic standard authentication method

    Enter your Snowflake username, such as admin and password.

    OAuth authentication method

    Enter your Snowflake OAuth Client ID and Client Secret to connect to your Snowflake connector.

    Note

    Prior to connecting with OAuth, set up your Snowflake environment with the Security Integration Object.



  6. Click Next.

  7. On the Select data page, in the Directory field, select the directory for the data set. Click Next.

    For data imports with high performance, switch the toggle on to import using S3 unload.

    Note

    Using the S3 unload to import data with high performance may incur data transfer costs. To review the costs, see the Data Transfer section of the Snowflake pricing guide.

  8. On the Import data page, review your data and select the data to obfuscate (if any). Click Next.

  9. On the Filter data page, optionally click Filter data to refine your data, or click Import data to continue.

    1. Filter the rows in your data by selecting the column to filter, the filter category and the value or text.

    2. Click Import data to continue.

    Note

    For more information about how to configure data filters, see: Filter data.

  10. On the Review page, review the data sets that you are importing.

  11. Click Import data.

    The data is available on the My Data page.

Usage examples

After creating the connection, you can view a list of available tables under your database based on the role. You can search for and select the specific table data that you want to analyze, complete the configuration steps, and start the import.

When your data is available in Symon.AI, where you can view and start analyzing it in a pipe.

Security and privacy

We use two authentication practices to connect with Snowflake:

  • Basic standard username and password authentication practices, and securely store encrypted passwords.

  • OAuth authentication method with Client ID and Client Secret authentication practices.

Error handling

The following errors may appear during the import process:

Table 21. 

Error

Description

Solution

No active warehouse selected in the current session

There is an incorrect warehouse name.

To fix this error, enter the correct warehouse name.

Database doesn't exist or not authorized

There is an incorrect database name.

To fix this error, enter the correct database name.

This session does not have a current database

There is an incorrect database name.

To fix this error, enter the correct database name.

Data in column '${fieldName}' exceeds the max length of ${maxLength} characters.

This error occurs if a fieldName from your Snowflake table has too many characters.

To fix this error, see your Snowflake account and make the appropriate updates.

Table ${tableName} not found, or you are not authorized to access it.

This error occurs during Snowflake SQL compilation, when the SQL script is trying to access tables that don't exist or doesn't have access to.

To fix this error, see your Snowflake account and make the appropriate updates.

Number of columns could not exceed 150.

This error occurs when the imported data has too many columns. This is not a performance issue on the Symon.AI side, but is caused by the Snowflake python connector (maintained by Snowflake) pulling in too much data in parallel which results in a memory issue. Based on the testing results, Symon.AI sets a limitation of 150 columns.

To fix this error, see your Snowflake account and make the appropriate updates.