I’m currently looking for the best way to share data from Databricks with customers using Snowflake. Are there any suggestions on how Snowflake can read data shared via Delta Sharing from Databricks? If not, are there alternative mechanisms for sharing tables from Databricks with Snowflake customers?
I’ve also read about Lakehouse Federation and querying data from Snowflake to Databricks. For those who have experience sharing data between Databricks and Snowflake, what has worked best for you? Any documentation would be appreciated.
To share direct Delta Sharing from Databricks to Snowflake, you can follow these steps:
- Enable Delta Sharing for your Databricks account as a provider. In Delta Sharing, a share is a read-only group of tables and table partitions that a provider wishes to share with one or more recipients.
The below is the approach will let you enable the Delta sharing:
Know more about What is Delta Sharing?
- Set up a connection to Snowflake using the Snowflake connector in Databricks Runtime. You will need to provide the Host, Port, user credentials, warehouse name, database, schema, and table details.
Below is the code:
DROP TABLE IF EXISTS snowflake_table;
CREATE TABLE snowflake_table
USING snowflake
OPTIONS (
host '<hostname>',
port '<port>',
user '<username>',
password '<password>',
sfWarehouse '<warehouse_name>',
database '<database-name>',
schema '<schema-name>',
dbtable '<table-name>'
);
SELECT * FROM snowflake_table;
Reference: how do we use delta sharing between databricks to snowflake