Snowflake
This documentation describes the integration of MindsDB with Snowflake, a cloud data warehouse used to store and analyze data. The integration allows MindsDB to access data stored in the Snowflake database and enhance it with AI capabilities.
Prerequisites
Before proceeding, ensure the following prerequisites are met:
- Install MindsDB locally via Docker or Docker Desktop.
- To connect Snowflake to MindsDB, install the required dependencies following this instruction.
Connection
Establish a connection to your Snowflake database from MindsDB by executing the following SQL command:
Required connection parameters include the following:
account
: The Snowflake account identifier. This guide will help you find your account identifier.user
: The username for the Snowflake account.password
: The password for the Snowflake account.database
: The name of the Snowflake database to connect to.
Optional connection parameters include the following:
warehouse
: The Snowflake warehouse to use for running queries.schema
: The database schema to use within the Snowflake database. Default isPUBLIC
.role
: The Snowflake role to use.
This video presents how to connect to Snowflake and query the available tables.
Usage
Retrieve data from a specified table by providing the integration name, schema, and table name:
Run Snowflake SQL queries directly on the connected Snowflake database:
The above examples utilize snowflake_datasource
as the datasource name, which is defined in the CREATE DATABASE
command.
Troubleshooting Guide
Database Connection Error
- Symptoms: Failure to connect MindsDB with the Snowflake account.
- Checklist:
- Make sure the Snowflake is active.
- Confirm that account, user, password and database are correct. Try a direct Snowflake connection using a client like DBeaver.
- Ensure a stable network between MindsDB and Snowflake.
SQL statement cannot be parsed by mindsdb_sql
- Symptoms: SQL queries failing or not recognizing table names containing spaces or special characters.
- Checklist:
- Ensure table names with spaces or special characters are enclosed in backticks.
- Examples:
- Incorrect: SELECT * FROM integration.travel data
- Incorrect: SELECT * FROM integration.‘travel data’
- Correct: SELECT * FROM integration.`travel data`
This troubleshooting guide provided by Snowflake might also be helpful.
Was this page helpful?