Skip to main content

Symon.AI help center

Snowflake

Abstract

Connect your Symon.AI and Snowflake accounts to export your data to your Snowflake account.

Connect your Symon.AI and Snowflake accounts to export your data to your Snowflake account. This connection allows Symon.AI to write data to Snowflake.

Set up the connector to be available for use with the Export tool. You only need to set up the connection once. After the connection is set up, Symon.AI can write updates and inserts into Snowflake.

Before you begin

Ensure that the necessary privilege are granted to the role to write to the table. If the role is omitted in the Snowflake connection, the default role of the user is used. For more information, see Configuring access control.

New table in new schema

New table in existing schema

Update existing table

USAGE on warehouse

Yes

Yes

Yes

USAGE on database

Yes

Yes

Yes

USAGE on schema

No

Yes

Yes

USAGE on file format

Yes

Yes

Yes

CREATE SCHEMA on database

Yes

No

No

CREATE TABLE on schema

No

Yes

No

OWNERSHIP on table

No

No

Yes

Snowflake file format

To load data into a Snowflake table, you need to use file format. File format is the Snowflake object that describes the format of a file. A file format object requires the following properties:

type = csv
escape = \
field_optionally_enclosed_by = "
Create file format
  1. Ensure that the user has the necessary privileges to create file format:

    • USAGE on warehouse

    • USAGE on database

    • USAGE on schema

    • CREATE FILE FORMAT on schema

    Note

    You don't need to create the file format object each time, but ensure that there is one valid file format object and the role has access to it within the database used for the connection.

  2. Create the file format in Snowflake for a .csv file:

    CREATE FILE FORMAT {database}.{schema}.{file_format_name}

    TYPE = 'CSV' ESCAPE='\\' FIELD_OPTIONALLY_ENCLOSED_BY='“';

Create and update tables

Symon.AI only supports creating and updating tables with a primary key. For duplicate rows with the same primary key value, the latest row record is used. Any rows that have been updated during an export that fails, cannot be reverted. For more information, see Snowflake primary keys.

Create the connection

Create the connection between Symon.AI and Snowflake. Generate a new connection or use an existing one.

Creating a new connection
  1. In Symon.AI, go to your pipe.

  2. Add the Export tool.

  3. In the Export tool configuration section, click the Connection drop-down.

  4. From the Connection drop-down, click + New connection.

  5. Create the new Snowflake connection for the Export tool.

    1. On the Connect to your Data page, enter the following information:

    Field

    Description

    Connector name

    The name of the connection.

    Snowflake URL

    The URL to connect to Snowflake, such as https://<variable>.snowflakecomputing.com.

    Snowflake role

    The role in Snowflake.

    Warehouse

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

    Database name

    The name of the Snowflake database.

    Username

    The Snowflake user name, such as admin.

    Password

    The Snowflake password.

  6. Click Next.

    You are sent back to your pipe page and the Export tool configuration is opened.

  7. In the Export tool configuration panel, enter the following information:

    Field

    Description

    Table name

    The name of the table to create or update.

    Schema

    The schema where the updated table belongs to, or the intended schema for new tables.

    File format

    The drop-down list of valid file formats where the user can choose from. This list only displays the valid formats that the role has access to.

    Key columns

    The drop-down list of columns to select primary key columns from.

  8. Click Export now.

Using your existing Snowflake connection
  1. In Symon.AI, go to your pipe.

  2. Add the Export tool.

  3. In the Export tool configuration, click the Connection drop-down.

  4. Search for and select your existing Snowflake export connection.

  5. In the Export tool configuration panel, enter the following information:

    Field

    Description

    Table name

    The name of the table to create or update.

    Schema

    The schema where the updated table belongs to, or the intended schema for new tables.

    File format

    The drop-down list of valid file formats where the user can choose from. This list only displays the valid formats that the role has access to.

    Key columns

    The drop-down list of columns to select primary key columns from.

  6. Click Export now.