❄️ Snowflake Integration Guide
Connect your Snowflake account to mimilabs data using Delta Direct — Snowflake's native ability to read Delta tables from S3.
Enterprise Feature: Snowflake integration is available with an Enterprise license. Contact info@mimilabs.ai to get started.
Already using Databricks? Delta Sharing is even simpler — contact us for setup.
How It Works
Your Snowflake account assumes an IAM role we provision, giving it read-only access to the specific tables you've requested.
┌─────────────────┐ ┌─────────────────┐
│ Your │ assumes role │ mimilabs │
│ Snowflake │ ──────────────────────────► │ AWS │
│ Account │ │ │
└─────────────────┘ └────────┬────────┘
│ reads
▼
┌─────────────────┐
│ S3 (Delta) │
│ mimilabs data │
└─────────────────┘
Step 1: Request Enterprise Access
Contact us at info@mimilabs.ai with:
- Your organization and use case
- Which tables or schemas you need
Once your Enterprise license is set up, we'll provision access and send you:
- S3 path(s) for your requested tables
- IAM Role ARN to assume
Step 2: Create Catalog Integration
Run this once in your Snowflake account (requires ACCOUNTADMIN role):
-- Run this once per Snowflake account
CREATE OR REPLACE CATALOG INTEGRATION mimi_ws_1
CATALOG_SOURCE = OBJECT_STORE
TABLE_FORMAT = DELTA
ENABLED = TRUE;Step 3: Create External Volume
We'll provide you with the specific S3 path and IAM Role ARN. Use them in this template:
CREATE OR REPLACE EXTERNAL VOLUME mimilabs_volume
STORAGE_LOCATIONS = (
(
NAME = 'mimilabs-data'
STORAGE_PROVIDER = 'S3'
STORAGE_BASE_URL = '{{S3_PATH_PROVIDED_BY_MIMILABS}}'
STORAGE_AWS_ROLE_ARN = '{{IAM_ROLE_ARN_PROVIDED_BY_MIMILABS}}'
)
)
ALLOW_WRITES = FALSE;Example with real values:
CREATE OR REPLACE EXTERNAL VOLUME mimilabs_volume
STORAGE_LOCATIONS = (
(
NAME = 'mimilabs-data'
STORAGE_PROVIDER = 'S3'
STORAGE_BASE_URL = 's3://mimilabs-data-share/client-abc/nppes/'
STORAGE_AWS_ROLE_ARN = 'arn:aws:iam::533267369554:role/mimilabs-client-abc-role'
)
)
ALLOW_WRITES = FALSE;Step 4: Send Us Your Snowflake Credentials
After creating the external volume, run:
DESC EXTERNAL VOLUME mimilabs_volume;Send us these two values from the output:
STORAGE_AWS_IAM_USER_ARNSTORAGE_AWS_EXTERNAL_ID
We'll update our IAM trust policy to authorize your Snowflake account.
Step 5: Create Database and Schema
Set up where your mimilabs tables will live:
CREATE DATABASE IF NOT EXISTS mimi_ws_1;
CREATE SCHEMA IF NOT EXISTS mimi_ws_1.nppes; -- or other schema name
USE DATABASE mimi_ws_1;
USE SCHEMA nppes;Tip: We recommend using
mimi_ws_1as your database name and matching schema names (e.g.,nppes,fda,cmscoding) to stay consistent with our Databricks environment. This way, SQL queries generated by mimibot can be used directly in your Snowflake without modification.
Step 6: Create Iceberg Tables
Once we confirm the IAM trust policy is updated, create tables for each dataset:
Single Table Setup
CREATE ICEBERG TABLE {{TABLE_NAME}}
BASE_LOCATION = ''
EXTERNAL_VOLUME = 'mimilabs_volume'
CATALOG = 'mimi_ws_1'
AUTO_REFRESH = TRUE;Multiple Tables (Shared Parent Path)
If we've set up your external volume to point to a parent directory containing multiple tables:
-- NPPES Provider Directory
CREATE ICEBERG TABLE npidata
BASE_LOCATION = 'npidata/'
EXTERNAL_VOLUME = 'mimilabs_volume'
CATALOG = 'mimi_ws_1'
AUTO_REFRESH = TRUE;
-- FDA NDC Directory
CREATE ICEBERG TABLE ndc_directory
BASE_LOCATION = 'ndc_directory/'
EXTERNAL_VOLUME = 'mimilabs_volume'
CATALOG = 'mimi_ws_1'
AUTO_REFRESH = TRUE;
-- HCPCS Codes
CREATE ICEBERG TABLE hcpcs
BASE_LOCATION = 'hcpcs/'
EXTERNAL_VOLUME = 'mimilabs_volume'
CATALOG = 'mimi_ws_1'
AUTO_REFRESH = TRUE;Step 7: Query Your Data
-- Query NPPES provider directory
SELECT npi, provider_first_name, provider_last_name_legal_name,
provider_business_practice_location_address_city_name,
provider_business_practice_location_address_state_name
FROM mimi_ws_1.nppes.npidata
LIMIT 10;Quick Reference: Complete Setup Script
Copy and customize this full script:
-- ============================================
-- MIMILABS SNOWFLAKE INTEGRATION SETUP
-- ============================================
-- 1. Create catalog integration (one-time)
CREATE OR REPLACE CATALOG INTEGRATION mimi_ws_1
CATALOG_SOURCE = OBJECT_STORE
TABLE_FORMAT = DELTA
ENABLED = TRUE;
-- 2. Create external volume
-- Replace placeholders with values from mimilabs
CREATE OR REPLACE EXTERNAL VOLUME mimilabs_volume
STORAGE_LOCATIONS = (
(
NAME = 'mimilabs-data'
STORAGE_PROVIDER = 'S3'
STORAGE_BASE_URL = '{{S3_PATH}}'
STORAGE_AWS_ROLE_ARN = '{{IAM_ROLE_ARN}}'
)
)
ALLOW_WRITES = FALSE;
-- 3. Get credentials to send to mimilabs
DESC EXTERNAL VOLUME mimilabs_volume;
-- >>> Send STORAGE_AWS_IAM_USER_ARN and STORAGE_AWS_EXTERNAL_ID to mimilabs <<<
-- 4. Create database/schema (use mimi_ws_1 for mimibot query compatibility)
CREATE DATABASE IF NOT EXISTS mimi_ws_1;
CREATE SCHEMA IF NOT EXISTS mimi_ws_1.{{SCHEMA_NAME}};
-- 5. Create tables (after mimilabs confirms IAM setup)
CREATE ICEBERG TABLE mimi_ws_1.{{SCHEMA_NAME}}.{{TABLE_NAME}}
BASE_LOCATION = '{{BASE_LOCATION}}'
EXTERNAL_VOLUME = 'mimilabs_volume'
CATALOG = 'mimi_ws_1'
AUTO_REFRESH = TRUE;
-- 6. Query (same syntax as mimibot/Databricks)
SELECT * FROM mimi_ws_1.{{SCHEMA_NAME}}.{{TABLE_NAME}} LIMIT 10;Refreshing Data
With AUTO_REFRESH = TRUE, your Iceberg tables automatically detect new data — no action required.
To manually trigger a refresh:
ALTER ICEBERG TABLE mimi_ws_1.{{SCHEMA_NAME}}.{{TABLE_NAME}} REFRESH;To check the last refresh time:
SHOW ICEBERG TABLES LIKE '{{TABLE_NAME}}';Troubleshooting
not authorized to perform: sts:AssumeRole
- Cause: IAM trust policy not configured
- Solution: Send us your
STORAGE_AWS_IAM_USER_ARNandSTORAGE_AWS_EXTERNAL_ID
Failed to find the metadata of Delta table
- Cause: Wrong path or
BASE_LOCATION - Solution: Verify
BASE_LOCATIONmatches the table subdirectory
Forbidden (Status Code: 403)
- Cause: IAM permissions issue
- Solution: Contact mimilabs — we'll check the policy
Invalid value for parameter 'CATALOG_SOURCE'
- Cause: Snowflake edition limitation
- Solution: Delta Direct requires Snowflake Enterprise Edition or higher
Need Help?
Contact us at info@mimilabs.ai with:
- Your Snowflake account identifier
- Error messages (if any)
- Which tables you're trying to access