Connect to Snowflake¶
This guide will help you set up a FeatureByte feature store in a Snowflake Data Warehouse.
Before You Begin¶
Gather the credentials for connecting to your snowflake account, specifically:
- Name of the snowflake server you're connecting to
- Sign-in credentials for the snowflake server
- Name of Snowflake role that will have access to the feature store assets
You'll also want to ensure that the user you're connecting with has the relevant privileges that are required. Specifically, the role should have the following privileges:
USAGE
onWAREHOUSE
USAGE
onDATABASE
These can be granted via:
GRANT USAGE ON WAREHOUSE {warehouse} TO ROLE {role};
GRANT USAGE ON DATABASE {database} TO ROLE {role};
Why are these privileges needed?
These privileges are needed for featurebyte to write some metadata into your Snowflake data warehouse. This is used internally by our application to track some metadata, and perform some optimizations to make your experience better.Setup Guide¶
FeatureByte Installation
Make sure that you have FeatureByte installed. See installation for more details.
Step 1: Test that your connection works¶
We can now try to see if your connection works by trying to create a new feature store. We can do so by running the following commands (either in a notebook, or a python interactive shell).
- If you know that a feature store exists already, we can try to list the existing feature stores on snowflake.
- Alternatively, try to create a feature store.
feature_store = fb.FeatureStore.get_or_create( # Name of the feature store that we want to create/connect to name="<feature_store_name>", source_type=fb.SourceType.SNOWFLAKE, details=fb.SnowflakeDetails( """ The host account name which can be found using one of the following formats: - For Amazon Web Services US West, use `<account>.snowflakecomputing.com` - For all other regions on Amazon Web Services, use `<account>.<region>.snowflakecomputing.com` - For all regions on Microsoft Azure, use `<account>.<region>.azure.snowflakecomputing.com` """ account="<account>", warehouse="snowflake", database_name="<database_name>", schema_name="<schema_name>", role_name="DEVELOPER", ), database_credential=fb.UsernamePasswordCredential( username="<username>", password="<password>", ) )
Step 2: Connect to your Snowflake feature store¶
Congratulations! You have successfully connected to your Snowflake data warehouse if you are able to run these commands without any errors!
Next Steps¶
Now that you've connected to your data, feel free to try out some tutorials!