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.
Important!
When querying data from Snowflake, MindsDB automatically converts column names to lower-case. To prevent this, users can provide an alias name as shown below.
This update is introduced with the MindsDB version 25.3.4.1. It is not backward-compatible and has the following implications:
Queries to Snowflake will return column names in lower-case from now on.
The models created with Snowflake as a data source must be recreated.
How it works
The below query presents how Snowflake columns are output when queried from MindsDB.
Copy
Ask AI
SELECT CC_NAME, -- converted to lower-case CC_CLASS AS `CC_CLASS`, -- provided alias name in upper-case CC_EMPLOYEES, cc_employeesFROM snowflake_data.TPCDS_SF100TCL.CALL_CENTER;
Here is the output:
Copy
Ask AI
+--------------+----------+--------------+--------------+| cc_name | CC_CLASS | cc_employees | cc_employees |+--------------+----------+--------------+--------------+| NY Metro | large | 597159671 | 597159671 || Mid Atlantic | medium | 944879074 | 944879074 |+--------------+----------+--------------+--------------+
Run Snowflake SQL queries directly on the connected Snowflake database:
Copy
Ask AI
SELECT * FROM snowflake_datasource ( --Native Query Goes Here SELECT employee_table.* EXCLUDE department_id, department_table.* RENAME department_name AS department FROM employee_table INNER JOIN department_table ON employee_table.department_id = department_table.department_id ORDER BY department, last_name, first_name;);
The above examples utilize snowflake_datasource as the datasource name, which is defined in the CREATE DATABASE command.