Skip to main content

Export Kapiche Data into Snowflake

Refer to these instructions if you'd like Kapiche to do the export.

Christina Petrakos avatar
Written by Christina Petrakos
Updated over 9 months ago

To integrate Kapiche with Snowflake, you’ll need to provide the following information:

• Host

• Role

• Warehouse

• Database

• Schema

• Username

• Password

Additionally, a dedicated read-only Kapiche user and role must be created with access to the necessary schemas, which will be determined through an iterative process with the customer.

Step 1: Setup Kapiche-specific Entities in Snowflake

Use the script below in a new Snowflake worksheet to create the necessary entities. Modify the password and resource names as needed.

-- set variables (these need to be uppercase)
set kapiche_role = 'KAPICHE_ROLE';
set kapiche_username = 'KAPICHE_USER';
set kapiche_warehouse = 'KAPICHE_WAREHOUSE';
set kapiche_database = 'KAPICHE_DATABASE';
set kapiche_schema = 'KAPICHE_SCHEMA';

-- set user password
set kapiche_password = 'password';

begin;

-- create Kapiche role
use role securityadmin;
create role if not exists identifier($kapiche_role);
grant role identifier($kapiche_role) to role SYSADMIN;

-- create Kapiche user
create user if not exists identifier($kapiche_username)
password = $kapiche_password
default_role = $kapiche_role
default_warehouse = $kapiche_warehouse;

grant role identifier($kapiche_role) to user identifier($kapiche_username);

-- change role to sysadmin for warehouse / database steps
use role sysadmin;

-- create Kapiche warehouse
create warehouse if not exists identifier($kapiche_warehouse)
warehouse_size = xsmall
warehouse_type = standard
auto_suspend = 60
auto_resume = true
initially_suspended = true;

-- create Kapiche database
create database if not exists identifier($kapiche_database);

-- grant Kapiche warehouse access
grant USAGE
on warehouse identifier($kapiche_warehouse)
to role identifier($kapiche_role);

-- grant Kapiche database access
grant OWNERSHIP
on database identifier($kapiche_database)
to role identifier($kapiche_role);

commit;

begin;

USE DATABASE identifier($kapiche_database);

-- create schema for Kapiche data
CREATE SCHEMA IF NOT EXISTS identifier($kapiche_schema);

commit;

begin;

-- grant Kapiche schema access
grant OWNERSHIP
on schema identifier($kapiche_schema)
to role identifier($kapiche_role);

commit;

Step 2: Setup Data Loading Method

Kapiche uses Snowflake’s Internal Stage to load data. Ensure the database and schema have the USAGE privilege.

Step 3: Send your Kapiche Customer Success Manager or Account Manager the following details

• Host

• Role

• Warehouse

• Database

• Schema

• Username

• Password

Did this answer your question?