Snowflake connection to databricks error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2023 01:40 AM
I am trying to connect to snowflake using data bricks but getting the below error
net.snowflake.client.jdbc.SnowflakeSQLException: JDBC driver encountered a communication error. Message: Exception encountered for HTTP request: Connect to xxx.region.snowflakecomputing.com:443 [XXX.region.snowflakecomputing.com/, XXX.region.snowflakecomputing.com/] failed: Read timed out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2023 08:44 PM
Hello @shivank25, Databricks provides a Snowflake connector in the Databricks Runtime to support reading and writing data from Snowflake.
Could you please try with below code and let me know if it works for you ?
snowflake_table = (spark.read
.format("snowflake")
.option("dbtable", table_name)
.option("sfUrl", database_host_url)
.option("sfUser", username)
.option("sfPassword", password)
.option("sfDatabase", database_name)
.option("sfSchema", schema_name)
.option("sfWarehouse", warehouse_name)
.load()
#Use snowflake connector
df = spark.read \
.format("snowflake") \
.options(options) \
.option("dbtable", "table_name") \
.load()
display(df)
Ref: https://docs.databricks.com/external-data/snowflake.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 06:27 AM - edited 07-07-2023 06:29 AM
Thanks for your response @Priyanka_Biswas .
I am getting the below error now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2023 02:45 AM
Hi @shivank25
Thank you for posting your question in our community! We are happy to assist you.
To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?
This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance!

