cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to read sql file from a Repo to string

pabloaus
New Contributor III

I am trying to read a sql file in the repo to string. I have tried

with open("/Workspace/Repos/xx@***.com//file.sql","r") as queryFile:
   queryText = queryFile.read()

And I get following error.

[Errno 1] Operation not permitted: '/Workspace/Repos/***@***.com//file.sql'

1 ACCEPTED SOLUTION

Accepted Solutions

Senthil1
Contributor

Hi @pablous,

Make sure your REPOS is enabled by checking in Admin console and have full read/list privileges to do from workspace.

If all are perfect, then need to check whether there is anything blocks when we enable Unity Catalog, but i didn't feel anything related to this, since you r hitting GIT integrated repo acess, not the METASTORE repo access

View solution in original post

2 REPLIES 2

Senthil1
Contributor

Hi @pablous,

Make sure your REPOS is enabled by checking in Admin console and have full read/list privileges to do from workspace.

If all are perfect, then need to check whether there is anything blocks when we enable Unity Catalog, but i didn't feel anything related to this, since you r hitting GIT integrated repo acess, not the METASTORE repo access

Senthil1
Contributor

I checked in my unity_catalog enabled cluster, i am able to access the @repos file to read and display

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