Skip to content

Snowflake

Steps to setup Snowflake


Fill the form with the credentials of your data source.

Screenshot Screenshot

Once the form is completed, it's necessary to test the connection to verify if Qualytics is able to connect to your source of data. A successful message will be shown:

Screenshot Screenshot

Warning

By clicking on the Finish button, it will create the Datastore and skipping the configuration of an Enrichment Datastore.

  • To configure an Enrichment Datastore in another moment, please refer to this section

Note

It is important to associate an Enrichment Datastore with your new Datastore

  • The Enrichment Datastore will allow Qualytics to record enrichment data, copies of the source anomalous data and additional metadata for your Datastore

Configuring an Enrichment Datastore

  • If you have an Enrichment Datastore already setup, you can link it by enable to use an existing Enrichment Datastore and select from the list

  • If you don't have an Enrichment Datastore, you can create one at the same page:

    Screenshot Screenshot

Once the form is completed, it's necessary to test the connection. A successful message will be shown:

Screenshot Screenshot

Warning

By clicking on the Finish button, it will create the Datastore and link or create the Enrichment Datastore


Fields

Name required

  • The datastore name to be created in Qualytics App

Account required

  • Host url to be connected.
  • Hostname in the form

        https://<account_name>.<region>.snowflakecomputing.com.
    

  • You can check here for more details.

Role required

  • Set this to the name of role that you want to use or which the account user has access to.

Warehouse required

  • The warehouse name that you want to use or which the account user has access to.

Database required

  • The database name to be connected or which the account user has access to.

Schema required

  • The schema name to be connected or which the account user has access to.

User required

  • The user that has access to the Snowflake Data Warehouse application.

Password required

  • The password that has access to the Snowflake Data Warehouse application.

Snowflake Qualytics Warehouse required

Create a Warehouse

  1. To create a warehouse with minimum requirements, you can use the following command:

        CREATE WAREHOUSE qualytics_wh
        WITH
            WAREHOUSE_SIZE = 'XSMALL'
            AUTO_SUSPEND = 60
            AUTO_RESUME = TRUE;
    
  2. To give a specific warehouse as the default for a user:

        ALTER USER <username> SET DEFAULT_WAREHOUSE = qualytics_wh;
    

Datastore Snowflake privileges permissions required

Creating a Custom Read-Only Role

  1. Create a new role called qualytics_read_role by running the following command:

        CREATE ROLE qualytics_read_role;
        GRANT USAGE ON WAREHOUSE qualytics_wh TO ROLE qualytics_read_role;
    
  2. Grant the USAGE privilege on the database, specific schema and table to the qualytics_read_role by running the following command:

        GRANT USAGE ON DATABASE <database_name> TO ROLE qualytics_read_role;
        GRANT USAGE ON SCHEMA <database_name>.<schema_name> TO ROLE qualytics_read_role;
        GRANT SELECT ON TABLE <database_name>.<schema_name>.<table_name> TO ROLE qualytics_read_role;
    
        GRANT SELECT ON ALL TABLES IN SCHEMA <database_name>.<schema_name> TO ROLE qualytics_read_role;
        GRANT SELECT ON ALL VIEWS IN SCHEMA <database_name>.<schema_name> TO ROLE qualytics_read_role;
    
        GRANT SELECT ON FUTURE TABLES IN SCHEMA <database_name>.<schema_name> TO ROLE qualytics_read_role;
        GRANT SELECT ON FUTURE VIEWS IN SCHEMA <database_name>.<schema_name> TO ROLE qualytics_read_role;
    
  3. Assign the qualytics_read_role to the desired user by running the following command:

        GRANT ROLE qualytics_read_role TO USER <user_name>;
    

Enrichment Datastore Snowflake privileges permissions required

Creating a Custom Read-Write Role

  1. Create a new role called qualytics_readwrite_role by running the following command:

        CREATE ROLE qualytics_readwrite_role;
        GRANT USAGE ON WAREHOUSE qualytics_wh TO ROLE qualytics_readwrite_role;
    
  2. Grant the USAGE and MODIFY privileges on the enrichment schema within the specific database and schema to the qualytics_readwrite_role by running the following command:

        GRANT USAGE, MODIFY ON DATABASE <database_name> TO ROLE qualytics_readwrite_role;
        GRANT USAGE, MODIFY ON SCHEMA <database_name>.<qualytics_schema> TO ROLE qualytics_readwrite_role;
        GRANT CREATE TABLE ON SCHEMA <database_name>.<qualytics_schema> TO ROLE qualytics_readwrite_role;
        GRANT SELECT ON FUTURE VIEWS IN SCHEMA <database_name>.<qualytics_schema> TO ROLE qualytics_readwrite_role;
        GRANT SELECT ON FUTURE TABLES IN SCHEMA <database_name>.<qualytics_schema> TO ROLE qualytics_readwrite_role;
        GRANT SELECT ON ALL TABLES IN SCHEMA <database_name>.<qualytics_schema> TO ROLE qualytics_readwrite_role;
        GRANT SELECT ON ALL VIEWS IN SCHEMA <database_name>.<qualytics_schema> TO ROLE qualytics_readwrite_role;
    
  3. Assign the qualytics_readwrite_role to the desired user by running the following command:

        GRANT ROLE qualytics_readwrite_role TO USER <user_name>;
    

Information on how to connect with Snowflake Data Warehouse


API Payload Examples

Creating a Datastore

This section provides a sample payload for creating a datastore. Replace the placeholder values with actual data relevant to your setup.

Endpoint (Post)

/api/datastores (post)

    {
        "name": "your_datastore_name",
        "teams": ["Public"],
        "database": "snowflake_database",
        "schema": "snowflake_schema",
        "enrich_only": false,
        "trigger_catalog": true,
        "connection": {
            "name": "your_connection_name",
            "type": "snowflake",
            "host": "snowflake_host",
            "username": "snowflake_username",
            "password": "snowflake_password",
            "parameters": {
                "role": "snowflake_read_role",
                "warehouse": "qualytics_wh"
            }
        }
    }
    {
        "name": "your_datastore_name",
        "teams": ["Public"],
        "database": "snowflake_database",
        "schema": "snowflake_schema",
        "enrich_only": false,
        "trigger_catalog": true,
        "connection_id": connection-id
    }

Creating an Enrichment Datastore

Endpoint (Post)

/api/datastores (post)

This section provides a sample payload for creating an enrichment datastore. Replace the placeholder values with actual data relevant to your setup.

    {
        "name": "your_datastore_name",
        "teams": ["Public"],
        "database": "snowflake_database",
        "schema": "snowflake_schema",
        "enrich_only": true,
        "connection": {
            "name": "your_connection_name",
            "type": "snowflake",
            "host": "snowflake_host",
            "username": "snowflake_username",
            "password": "snowflake_password",
            "parameters": {
                "role": "snowflake_readwrite_role",
                "warehouse": "qualytics_wh"
            }
        }
    }
    {
        "name": "your_datastore_name",
        "teams": ["Public"],
        "database": "snowflake_database",
        "schema": "snowflake_schema",
        "enrich_only": true,
        "connection_id": connection-id
    }

Linking Datastore to an Enrichment Datastore through API

Endpoint (Patch)

/api/datastores/{datastore-id}/enrichment/{enrichment-id} (patch)


Last update: June 14, 2024