I am trying to write to Snowflake using Snowpark from Azure Databricks and I get the following error. This error does not seem related to Unity Catalog but some configuration. I have made sure I have imported required libraries.
df_new.write.mode("append").saveAsTable("MyTableName")
Error: AnalysisException: [UC_NOT_ENABLED] Unity Catalog is not enabled on this cluster.
ADB Runtime: 13.3LTS ML
Python: 3.10.12
2
Answers
As I suspected, it had nothing to do with Unity Catalog. I need to create a Snowpark dataframe from my pandas dataframe to use its write method. This solved my problem.
where new_session is the snowpark session.
The error was misleading.
As per MS Document
As per error message It’s required that the cluster you are using should have unity catalog enabled then you will be able to query your catalog. After enabling unity catalog run
USE CATALOG my_catalog;
command to use it.You can follow this document to enable Unity catalog. After enabling it, execute your commands it will get succeeded.