Our Snowflake connection allows you to virtually connect to external Snowflake tables, and query on them, without having to physically move them into Zetaris.
Connect via NDP Fabric Builder
Connect via NDP Fabric Builder
Step 1: Click the Data Fabric Builder icon.
Step 2: Under Database Sources click the '+' next to Virtual Database Source to launch the wizard.
Step 3: When the GUI wizard launches accept the defaults and click Next.
Step 4: Specify the following values for the connection:
- Datasource: Snowflake
- Data Source Name: your database
- JDBC Driver Class: leave default
- JDBC Url: Expressed in the following form
jdbc:snowflake://{host}/?db={database}?schema={schema_name}
Parameters:
schema: schema name
Click Next.
Step 6: On the summary dialogue click Register.
Step 7: The Snowflake data source should now appear under
Connect via SQL Editor
The syntax to connect to Snowflake via SQL Editor is shown below
CREATE DATASOURCE SNOWFLAKE DESCRIBE BY "SNOWFLAKE" OPTIONS (
jdbcdriver "com.snowflake.client.jdbc.SnowflakeDriver",
jdbcurl "jdbc:snowflake://{host}",
username "username" ,
password "password",
db "{database}",
schema "{schema_name}"
);
REGISTER DATASOURCE TABLES FROM SNOWFLAKE;
Query Pushdown
Zetaris is able to pushdown the query to the Snowflake environment wherever it can by leverage the USING clause, in a SQL statement.
When writing the SQL statement, in the SQL Editor, you will need to reference the actual Schema name that table or tables resides inside of Snowflake. Check the below images for an example.
Image 1: Snowflake Database, Schema and Tables
Image 2: Zetaris SQL Editor referencing the Snowflake Schema and Tables, with USING statement to enable pushdown query.
In this example, since all tables in the query are refencing Snowflake, the entire query is pushed down to Snowflake, and only the result set is returned. Check the Snowflake monitoring console to check what query was run inside of Snowflake. It should be almost identical to the query mentioned in Zetaris.
Connection Troubleshooting
Snowflake query error:
- No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse'
Let's assume that the datasource connection already exists.
And we now want to see the metadata of the connection. In this case, we are looking at the table TEST01 in the database ZETARIS01, schema PIPELINE . Click the table name to expand the metadata high level contents.
However, we land up with this result.
Upon inspection, we find that the connection is complaining about not being assigned a warehouse, even though the datasource connection explicitly states a warehouse and there is a default warehouse to be used for the particular user in Snowflake.
Let's go take a look at Snowflake to see what the problem could be.
So far this looks fine. The user ZDEMO has been specified in the datasource connection. This user has the default role SALES and the deault warehouse WH_XSMALL assigned to it. What could the matter be?
Could it be the warehouse name?
Nope! All good on this front.
What is required is for the role that the user connects with to be able to actually use the warehouse. This is not obvious, but it a step that if missing will trip you up. The warehouse was created by the SYSADMIN role so the useage of the warehouse needs to be granted by that role or a superior role (in Snowflake, ACCOUNTADMIN role is the most senior role and is used to create accounts). So what happens once the usage privilege on the warehouse is granted?