cancel
Showing results for 
Search instead for 
Did you mean: 
Data Governance
Join discussions on data governance practices, compliance, and security within the Databricks Community. Exchange strategies and insights to ensure data integrity and regulatory compliance.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to query Unity Catalog tables from notebooks.

animadurkar
New Contributor III

In my workspace, I'm able to see the unity catalogs my team has created. I'm able to see the schemas and even query data in there and create views using the SQL Editor.

When I go to write the same sql queries from a notebook using spark.sql or %sql I get this error:

AnalysisException: [UC_NOT_ENABLED] Unity Catalog is not enabled on this cluster.

I reviewed my cluster and it is a:

  • Databricks ML 13.0 Runtime
  • Access Mode is Single User
  • Personal Compute Policy

I'm unsure why this is the case, especially if I can access it normally outside of the notebook. Does anyone have ways to fix this?

1 ACCEPTED SOLUTION

Accepted Solutions

animadurkar
New Contributor III

Figured it out. Had to just delete my personal cluster (which was created before the unity metastore was set up) and recreate it. Then if you run "USE CATALOG my_catalog;" before your queries in your notebook, it works great.

View solution in original post

6 REPLIES 6

animadurkar
New Contributor III

Figured it out. Had to just delete my personal cluster (which was created before the unity metastore was set up) and recreate it. Then if you run "USE CATALOG my_catalog;" before your queries in your notebook, it works great.

had a similar issue earlier.. thanks for the solution..

Ajay-Pandey
Esteemed Contributor III

Hi @Ani Madurkar​ ,

It's required that the cluster you are using should have unity catalog enabled then you will be able to query your catalog.

#DAIS2023​ 

image.pngimage.png

Ajay Kumar Pandey

youssefmrini
Databricks Employee
Databricks Employee

You need to make sure that in the cluster you are using you have the Unity Catalog tag. Then in the notebook add the use catalog ..... after this you will be able to query your table if you have the permission.

Anonymous
Not applicable

Hi @Ani Madurkar​ 

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! 

Thanks! just did

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group